X
xzmyzy
Unregistered / Unconfirmed
GUEST, unregistred user!
procedure TForm1.Button1Click(Sender: TObject);
var
srcFileHandle, desFileHandle: integer;
bufferointer;
iReadData, iBufferLen: integer;
begin
srcFileHandle:= fileopen('xzm.txt',fmopenread);
desFileHandle:= filecreate('xzmbak.txt');
iBufferLen:= 500;
getmem(buffer, iBufferLen);
try
while true do
begin
iReadData:= fileread(srcFileHandle, buffer,iBufferLen);
if iReadData <> 0 then
begin
filewrite(desFileHandle, buffer, iReadData);
end;
if iReadData < iBufferLen then break;
end;
fileclose(srcFileHandle);
fileclose(desFileHandle);//出错提示"External exception C0000008'怎么解决?
finally
freemem(buffer);//执行此语句时也出错,为什么?
end;
end;
var
srcFileHandle, desFileHandle: integer;
bufferointer;
iReadData, iBufferLen: integer;
begin
srcFileHandle:= fileopen('xzm.txt',fmopenread);
desFileHandle:= filecreate('xzmbak.txt');
iBufferLen:= 500;
getmem(buffer, iBufferLen);
try
while true do
begin
iReadData:= fileread(srcFileHandle, buffer,iBufferLen);
if iReadData <> 0 then
begin
filewrite(desFileHandle, buffer, iReadData);
end;
if iReadData < iBufferLen then break;
end;
fileclose(srcFileHandle);
fileclose(desFileHandle);//出错提示"External exception C0000008'怎么解决?
finally
freemem(buffer);//执行此语句时也出错,为什么?
end;
end;