Форум: "Основная";
Текущий архив: 2002.03.28;
Скачать: [xml.tar.bz2];
ВнизДинамические массивы в Дельфи Найти похожие ветки
← →
Vladimir1 (2002-03-14 15:07) [17]Вот текст:
procedure TForm1.Button1Click(Sender: TObject);
var f1,f2:textfile;
s1:array [1..500000] of string;
s:array [1..500000,1..4] of string;
{tim:array [1..1000,1..10] of tdatetime;}
i,j,k,finds,c,dur1,dur2:integer;
m:string;
timea1,timeb1,timea2,timeb2:tdatetime;
begin
assignfile(f1,"out.txt");
reset(f1);
assignfile(f2,"bbb.txt");
rewrite(f2);
i:=0;
while not eof(f1) do begin
inc(i);
readln(f1,s1[i]);
end;
for j:=1 to i do begin
finds:=pos(" 2503947",s1[j]);
if finds>0 then begin
s[j,1]:=copy(s1[j],15,8);
s[j,2]:=copy(s1[j],37,8);
s[j,3]:=copy(s1[j],50,8);
m:=s1[j];
c:=6;
if (m[63]=" ") and (m[64]<>" ") and (m[65]<>" ")
and (m[66]<>" ") and (m[67]<>" ") then c:=0;
if (m[63]=" ") and (m[64]=" ") and (m[65]<>" ")
and (m[66]<>" ") and (m[67]<>" ") then c:=1;
if (m[63]=" ") and (m[64]=" ") and (m[65]=" ")
and (m[66]<>" ") and (m[67]<>" ") then c:=2;
if (m[63]=" ") and (m[64]=" ") and (m[65]=" ")
and (m[66]=" ") and (m[67]<>" ") then c:=3;
if (m[63]=" ") and (m[64]=" ") and (m[65]=" ")
and (m[66]=" ") and (m[67]=" ") then c:=4;
if c=4 then s[j,4]:=copy(s[j],68,1);
if c=3 then s[j,4]:=copy(s1[j],67,2);
if c=2 then s[j,4]:=copy(s1[j],66,3);
if c=1 then s[j,4]:=copy(s1[j],65,4);
if c=0 then s[j,4]:=copy(s1[j],64,5);
end;
end;
for j:=1 to i do begin
timea1:=strtodatetime(s[j,2]+" "+s[j,3]);
dur1:=strtoint(s[j,4]);
timeb1:=timea1+dur1/86400;
if j+1<=i then begin
timea2:=strtodatetime(s[j+1,2]+" "+s[j+1,3]);
dur2:=strtoint(s[j+1,4]);
timeb2:=timea2+dur2/86400;
if timeb1>timea2 then begin
write(f2,s[j,1]);
write(f2," ");
write(f2,s[j,2]);
write(f2," ");
write(f2,s[j,3]);
write(f2," ");
write(f2,s[j,4]);
write(f2," ");
write(f2,datetimetostr(timea1));
write(f2," ");
write(f2,datetimetostr(timeb1));
write(f2," ");
write(f2,datetimetostr(timea2));
write(f2," ");
writeln(f2,datetimetostr(timeb2));
end;
end;
end;
closefile(f1);
closefile(f2);
end;
Это с обычными массивами, с динамическими - аналогично ругается.
Страницы: 1 вся ветка
Форум: "Основная";
Текущий архив: 2002.03.28;
Скачать: [xml.tar.bz2];
Память: 0.45 MB
Время: 0.01 c