SRL Archive - OSR Help

Invalid Number of parameters


bbbbbbbb

2012-11-23 14:06:27

One of the simplest scripts conceivable

program blah;
var
i:integer;

procedure Count;
begin
wait(10)
begin
writeln(i,'=I');
I :=i+1
end;
end;

begin
repeat count
until I>100
end.

can't see whats wrong yet i still get
Invalid number of parameters at line 9
Compiling failed.

euphemism

2012-11-23 14:07:42

WriteLn takes one parameter, X. You would have to do:


WriteLn('i = ' + IntToStr(I));

bbbbbbbb

2012-11-23 14:11:12

i'm still a noob to this so thanks for the help, i'll keep that in mind

euphemism

2012-11-23 14:47:26

Alternatively, you could do:


WriteLn(Format('i = %d', [I]));

Dgby714

2012-11-23 15:07:19

Just a note, it Lape, WriteLn works like Pascal's WriteLn with a variable number of arguments.

WriteLn('I = ', I, ';'); works in Lape but not PascalScript.