Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2002.05.06;
Скачать: CL | DM;

Вниз

Ошибка при импорте текстового файла с разделителем   Найти похожие ветки 

 
ruslan_as ©   (2002-04-22 10:15) [0]

На строке "while not SeekEOF(PathFile) do" вылезает ошибка I/O error 6. Пробовал "while not EOF(PathFile) do" тоже самое. В чем проблема.


procedure TfmVersion.Button2Click(Sender: TObject);
var
PathFile: TextFile;
ss,Path_,Platform: string;
Sep: char;
ii: integer;
VI: TOSVersionInfo;
begin
VI.dwOSVersionInfoSize := SizeOf(VI);
GetVersionEx(VI);
case VI.dwPlatformID of
VER_PLATFORM_WIN32_WINDOWS:Platform:="Windows 95/98";
VER_PLATFORM_WIN32_NT:Platform:="Windows NT";
end;
if Platform="Windows NT"
then Path_:="W:\Document\Общая\Ruslan\Install\God\Path2000.txt";
if Platform="Windows 95/98"
then Path_:="U:\Общая\Ruslan\Install\God\Path98.txt";
AssignFile(PathFile, Path_);
Sep:=#59; {разделитель ";"}
AssignFile(PathFile,"");
Reset(PathFile);
while not SeekEOF(PathFile) do
begin
ReadLn(PathFile,ss);
ii:=0;
while pos(Sep,ss)<>0 do
begin
Memo1.Lines.Add(Copy(ss,1,Pos(Sep,ss)));
Delete(ss,1,pos(Sep,ss));
Inc(ii);
end;
Memo1.Lines.Add(ss);
end;
CloseFile(PathFile);
end;


 
Song ©   (2002-04-22 10:23) [1]


Вот эту строку выкинуть: AssignFile(PathFile,""); Зачем второй раз пересвязывать?
И далее:
...
While not Eof(PathFile) Do
Begin
...


 
Song ©   (2002-04-22 10:27) [2]

А зачем Вам ii?


 
Anatoly Podgoretsky ©   (2002-04-22 10:37) [3]

Не поможет, текстовые файлы тольео последовательного доступа


 
Anatoly Podgoretsky ©   (2002-04-22 10:44) [4]

Извиниясь перепутал с SEEK, а ошибка вот здесь

AssignFile(PathFile, Path_);
Sep:=#59; {разделитель ";"}
!!! AssignFile(PathFile,"");

Переназнвчаешь!


 
ruslan_as ©   (2002-04-22 10:52) [5]

Спасибо! Увлекся со связыванием...



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

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

Наверх




Память: 0.47 MB
Время: 0.012 c
6-17658
Viking
2002-02-21 16:58
2002.05.06
Проблема с IdPOP3


1-17636
Дмитрий Орехов
2002-04-22 08:26
2002.05.06
QRCompositeReport


3-17475
rvs
2002-04-12 10:41
2002.05.06
Tquery


14-17688
Vladimir ;)
2002-03-28 22:55
2002.05.06
ЗАЦЕНИТЕ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!


4-17749
chielo
2002-03-04 14:52
2002.05.06
Как програмно открыть CD