Hello, can anyone help me with the following program? The problem seems to be in variable c, but it doesn't seems wrong to me. Can anyone please help me?
The text that the program reads is like this
3 2
1 2
1 3
1 2
Where 3 is n , so the procedure the program must be done 3 times, so as all the nums., will be read.
The message of the compiler is the following
the program.txt(33,1)Error: Wrong numbers of parameters specified for call to "space".
the program.txt(65)Fatal:There were 1 errors compiling module, stopping
the program.txt(0)Fatal:Compilation aborted
Program filetext;
Uses sysutils;
type
ca=String[1];
Var
a,j:array[1..100000] of String;
c:array[1..100000] of ca;
v:String[1];
n:String;
d:String;
i,m:Integer;
f:Text;
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 theprogram;
begin
thenum;
space;
sth;
end;
Procedure space;
begin
Read(f,c[i]);
Write(c[i]);
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);
for i:=1 to m do
theprogram;
if eof(f) then;
Close(f);
Readln;
End.