Formjd: TFormjd;
array1:array[0..10000] of string;
save:array[0..10000] of string;
org:array[0..10000,0..4] of integer;
j:integer; s15,s610,s1115,ty,re,left,sc:integer;
i,i5,p,lx,ct,oo:integer;
s,st,str,strtemp:string;
t:array[0..4] of string;
ed:array[0..10000] of integer;
implementation{$R *.dfm}procedure TFormjd.Button3Click(Sender: TObject);
var
iq,ia:integer;
tf : Textfile;
mobile: string;
begin
if OpenDialog1.Execute then
begin
Memo1.Lines.LoadFromFile(opendialog1.filename);
assignfile(tf, opendialog1.FileName);
reset(tf);
readln(tf, mobile);
iq:=0;
while mobile <> #$1A do
begin
array1[iq]:=mobile;
iq:=iq+1;
readln(tf, mobile);
end;
end; //取出源数据
j:=memo1.Lines.count-1;
for i:=0 to j do
begin
if trim(array1[i])='' then exit;
s:=array1[i];
st:=s;
for i5:=0 to 4 do
begin
p:=1;
while copy(st,p,1)<>' ' do
p:=p+1;
t[i5]:=copy(st,1,p-1);
org[i][i5]:=strtoint(t[i5]);
st:=copy(st,p+1,length(st)-p);
end;
end;
for ia:=0 to j do
begin
ed[ia]:=0;
end;left:=j+1;
sc:=0;
end;
我这段程序是为了读一个文件到数组array1中,文件每行是以空格间隔的数字,然后逐行读出信息,而ed【】是针对每行的一个标志位,我在添加一个文件时,当文件有几千行是程序窗口就自动关闭了,当文件行数少是就能实现我想要的功能,请问这是为什么阿?
array1:array[0..10000] of string;
save:array[0..10000] of string;
org:array[0..10000,0..4] of integer;
j:integer; s15,s610,s1115,ty,re,left,sc:integer;
i,i5,p,lx,ct,oo:integer;
s,st,str,strtemp:string;
t:array[0..4] of string;
ed:array[0..10000] of integer;
implementation{$R *.dfm}procedure TFormjd.Button3Click(Sender: TObject);
var
iq,ia:integer;
tf : Textfile;
mobile: string;
begin
if OpenDialog1.Execute then
begin
Memo1.Lines.LoadFromFile(opendialog1.filename);
assignfile(tf, opendialog1.FileName);
reset(tf);
readln(tf, mobile);
iq:=0;
while mobile <> #$1A do
begin
array1[iq]:=mobile;
iq:=iq+1;
readln(tf, mobile);
end;
end; //取出源数据
j:=memo1.Lines.count-1;
for i:=0 to j do
begin
if trim(array1[i])='' then exit;
s:=array1[i];
st:=s;
for i5:=0 to 4 do
begin
p:=1;
while copy(st,p,1)<>' ' do
p:=p+1;
t[i5]:=copy(st,1,p-1);
org[i][i5]:=strtoint(t[i5]);
st:=copy(st,p+1,length(st)-p);
end;
end;
for ia:=0 to j do
begin
ed[ia]:=0;
end;left:=j+1;
sc:=0;
end;
我这段程序是为了读一个文件到数组array1中,文件每行是以空格间隔的数字,然后逐行读出信息,而ed【】是针对每行的一个标志位,我在添加一个文件时,当文件有几千行是程序窗口就自动关闭了,当文件行数少是就能实现我想要的功能,请问这是为什么阿?
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货