TIP: Click on subject to list as thread! ANSI
echo: delphi
to: ALL
from: OLE ALMIND MORTENSEN
date: 1997-04-11 14:14:00
subject: Pointers / Blockread

Hello All!
Using Delphi 2.0
Type
  TRec = Record
    Item : String;
  End;
Var
  P : Pointer;
  MyRec : TRec;
  BF : File;
  Loop : Word;
Begin
  AssignFile(BF,'Myfile.dat'); //BF Holds E.G. 10 records
  Reset(BF,1);
  Getmem(P,FileSize(BF));
  BlockRead(BF,P^,FileSize(BF));
  For Loop:=1 To 10 Do
    Begin
>      Move(P^,MyRec,SizeOf(MyRec));
      ...
    End;
  Freemem(P,FileSize(BF));
  CloseFile(BF);
End;
Now to the problem which is with the move statement.
As you can see I have put the complete file into memory. With Move(P^,...
I have succeeded in moving the first record from memory to MyRec, but now I 
need to know how to move the NEXT to MyRec from P^.
Anybody who can help me out??
Kind regards Ole
    Team: Dark Skies
    Team: X-Files
--- Pr›v CDMag 2.50 fra Primeware.
---------------
* Origin: Nightcall Point (2:237/10.150)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.