冰
冰封
Unregistered / Unconfirmed
GUEST, unregistred user!
procedure TForm1.Button1Click(Sender: TObject);<br>var<br> hdl: Integer;<br> Buffer: PChar;<br>begin<br> buffer:=pchar(allocmem(4));<br> hdl:=fileopen('c:/a.dat',fmOpenread);<br> if hdl=-1 then showmessage('no open')<br> else<br> begin<br> fileseek(hdl,0,0);<br> fileread(hdl,buffer,4);<br> showmessage(buffer[0]);//运行到这句的时候错误。<br> end;<br> fileclose(hdl);<br>end;<br>