Witam, mam mały problem, a mianowicie, napisałem procedurę która zapisuje do pliku rekordy i gdy pętle for ustawię na 25 000 powtórzeń to program się sypie. Z góry dziękuję za pomoc.
{$APPTYPE CONSOLE}
uses
SysUtils;
type
tosoba = record
id: longint;
Imie: string[20];
Nazwisko: string[70];
Pesel: string[11];
Plec: char;
end;
p_osoba = file of tosoba;
t = array[1..100] of string;
tr = array of tosoba;
procedure stworz(var po: p_osoba);
begin
assign(po, 'lista.txt');
rewrite(po);
close(po);
end;
procedure rekord(var po: p_osoba; var tab: tr );
var
f:text;
e:text;
p,z,a,i:integer;
tabi:t;
tabn:t;
begin
p:=0;
z:=0;
assign(f,'imiona.txt');
reset(f);
assign(e,'nazwiska.txt');
reset(e);
for i:=1 to 100 do
begin
readln(f,tabi[i]);
readln(e,tabn[i]);
end;
setlength(tab,1000);
for i:=1 to 1000 do
begin
randomize;
p:=0;
z:=0;
p:=random(101)+1;
z:=random(101)+1;
begin
tab[i].id:=random(1000000)+1;
tab[i].Imie:=tabi[p];
tab[i].Nazwisko:=tabn[z];
a:=length(tab[i].Imie);
if tab[i].Imie[a] = 'a' then
tab[i].Plec:=('K')
else
tab[i].Plec:=('M');
end;
end;
close(f);
close(e);
assign(po, 'lista.txt');
reset(po);
for i:=1 to 1000 do
write(po,tab[i]);
readln;
close(po);
end;