Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2003.08.21;
Скачать: 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 вся ветка

Текущий архив: 2003.08.21;
Скачать: CL | DM;

Наверх




Память: 0.46 MB
Время: 0.015 c
14-68460
_Polymorphic_
2003-07-30 10:52
2003.08.21
Девушки-программистки. Миф или реальность?


7-68568
Алексей Глеб
2003-06-08 19:04
2003.08.21
Интерфейс


1-68257
kull
2003-08-06 10:04
2003.08.21
Работа с интерфейсами...


1-68358
Still_Swamp
2003-08-08 12:36
2003.08.21
новый message


3-68154
abc
2003-07-28 14:27
2003.08.21
как обновить только одну запись