type <br> txhjg = packed record<br> l1s1:integer;<br> l1s2:double;<br> l1s3:string[30];<br> end;<br> txhjgs = array [0..MaxInt-1] of txhjg;<br> pxhjgs = ^txhjgs;<br><br>var<br> FileHandle, MapHandle: THandle;<br> p: pxhjgs;<br>begin<br> FileHandle := fileOpen('xhcl.jg', fmOpenReadWrite);<br> if FileHandle <> INVALID_HANDLE_VALUE then<br> try<br> maphandle := CreateFileMapping(FileHandle, nil, PAGE_READWRITE, 0, 0, 0);<br> if maphandle <> INVALID_HANDLE_VALUE then<br> try<br> p := MapViewOfFile(maphandle, FILE_MAP_ALL_ACCESS, 0, 0, 0);<br> if p <> nil then<br> begin<br> p[2].l1s1 := 12;<br> UnmapViewOfFile(p);<br> end;<br> finally<br> closehandle(maphandle);<br> end;<br> finally<br> fileclose(filehandle);<br> end;<br>end;