SRL Archive - General

my first WriteIn didnt compile


jijib

2008-07-17 21:20:17

program script;

const
Message1='Hello world!';

procedure Hello;
begin
wait(1000)
WriteIn('Hello world');
end;


begin
repeat
hello;
until(false)
end.









can someone tell me wat i did wrong with this procedure

Cazax

2008-07-17 21:27:28

Its WriteLn with L not with I. And please use SCAR tags.

jijib

2008-07-17 23:06:28

thx

hahicx

2008-07-18 08:21:10

I've indented your script to make it look nicer:


program HelloSpam;

const
Message1 = 'Hello World!';

procedure Hello;
begin
wait(1000);
Writeln(Message1);
end;

begin
repeat
Hello;
until(False);
end.


Couple of comments:

In your original script, you declared the constant but didn't use it in the procedure! With your Writeln, you should replace the string with the name of the constant.

It's normally a bad idea to have repeat until(False) loops without a break in, as a failsafe. As this is a test script, it's OK, but you shouldn't really use it like that in a longer RS script.