Death12652
2010-05-13 01:09:05
Sorry for so many threads but this is helping greatly. When I am done with this script I will start my RS script. Anyway, is there a way to go back to part of a procedure and do it again a certain amount of times?
2010-05-13 01:09:05
2010-05-13 01:39:44
Procedure Example;
var
c:integer;
begin
c:=0;
repeat
writeln('this is an example');
c:=c+1
until(c>5)
end;2010-05-13 08:30:13
2010-05-13 08:34:46
2010-05-13 09:44:33
From: Rasta Magician
I think he meant using labels. But those are generally discouraged and loops should sort you out well enough :)
~RM
var
c : integer;
label
here;
begin
here:
writeln('hello');
inc(c);
if c >= 5 then exit;
if not this then goto here;
end.
2010-05-13 09:45:40
program new;
procedure testme(value : boolean);
var
bool : boolean;
begin
try
bool := value;
Writeln('bool = ' + booltostr(bool));
if bool then
begin
Writeln('Bool was true, lets exit!');
exit;
end;
Writeln('Bool was not true..');
finally
Writeln('We catched the exit!');
end;
end;
begin
testme(true);
testme(false);
end.