Вниз
Скачать: CL | DM;

Работа с файлами   Найти похожие ветки 

← →
SergeyI ©   (2003-06-20 11:26) [0]

Уважаемые ALL, помогите решить проблему не могу прочитать файл
вот код

var
iFileHandle: Integer;
iFileLength: Integer;
iBytesRead: Integer;
Buffer: PChar;
i: Integer ;
begin
try
iFileHandle := FileOpen(FiName, fmOpenRead);
iFileLength := FileSeek(iFileHandle,0,2);
FileSeek(iFileHandle,0,0);
Buffer := PChar(AllocMem(iFileLength + 1));
iBytesRead := FileRead(iFileHandle, Buffer, iFileLength);
( iFileHandle)
Уважаемые ALL, помогите решить проблему не могу прочитать файл
вот код

var
iFileHandle: Integer;
iFileLength: Integer;
iBytesRead: Integer;
Buffer: PChar;
i: Integer ;
begin
try
iFileHandle := FileOpen(FiName, fmOpenRead);
iFileLength := FileSeek(iFileHandle,0,2);
FileSeek(iFileHandle,0,0);
Buffer := PChar(AllocMem(iFileLength + 1));
iBytesRead := FileRead(iFileHandle, Buffer, iFileLength);
FileClose(iFileHandle);

после выполнения Buffer= "" iBytesRead = 0


← →
Palladin ©   (2003-06-20 11:48) [1]

iBytesRead := FileRead(iFileHandle, Buffer^, iFileLength);

iBytesRead=0 тебе повезло и программа не сглючила ибо ничего не прочиталось...



Страницы: 1 вся ветка

Скачать: CL | DM;



Память: 0.45 MB
Время: 0.017 c
3-68242
Alexey Nepryahin
2003-07-17 12:50
2003.08.21
ADO + Excell


1-68281
anri
2003-08-06 12:03
2003.08.21
Проверка на соответствие типу


14-68557
Рыжий Вася
2003-08-02 10:14
2003.08.21
Проверка в английском Word е


3-68210
Magic&Wizard
2003-07-28 11:24
2003.08.21
FireBird 1.5 vs InterBase 7.0


1-68354
Vulko
2003-08-09 03:54
2003.08.21
Как получить адрес temp директории в винде?




   Наверх