can anyone help me with the following program? There is no compile message, but during the runtime, an error is occured, and the message is, exited with exitcode=217. What seems to be the problem?
The text that the program reads is like this
3 2
1 2
1 3
1 2
Where 3 is n for instance, so the procedure the program must be done 3 times, so as all the nums., will be read.
Program sth;
Uses
SysUtils;
Var
m:Integer;
LowArr:Integer;
HighArr:Integer;
n,d:String;
f:Text;
TheArray,j:array of integer;
a:array of char;
c:array of string[1];
v:String[1];
i:Integer;
Procedure thenum ;
Begin
repeat
Read (f,a[i]);
Write(a[i]);
until (a[i]=' ');
End;
Procedure sth ;
begin
while not seekEoln and eof(f) do
begin
read(f,j[i]);
Write(j[i]);
end;
End;
procedure space;
begin
Read(f,c[i]);
Write(c[i]);
end;
Procedure theprogram;
begin
thenum;
space;
sth;
end;
begin
Assign(f,'textfile.txt');
Reset(f);
repeat
Read (f,n);
Write(n);
until (n=' ');
Read(f,v);
Write(v);
while not seekEoln and eof(f) do
begin
read(f,d);
Write(d);
end;
StrToIntDef(n,m);
setlength(thearray,m);
LowArr:=Low(Thearray);
HighArr:=High(TheArray);
for i:= LowArr to HighArr do
theprogram;
if eof(f) then;
Close(f);
Readln;
End.