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?
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?
repeat
.....
....
until
example:
SCAR Code:Procedure Example;
var
c:integer;
begin
c:=0;
repeat
writeln('this is an example');
c:=c+1
until(c>5)
end;
Think I forgot an end/begin but you get the point![]()
Last edited by Bebe; 05-13-2010 at 05:42 AM.
Bebe, you were correct.![]()
Writing an SRL Member Application | [Updated] Pascal Scripting Statements
My GitHub
Progress Report:13:46 <@BenLand100> <SourceCode> @BenLand100: what you have just said shows you have serious physchological problems 13:46 <@BenLand100> HE GETS IT! 13:46 <@BenLand100> HE FINALLY GETS IT!!!!1
I think he meant using labels. But those are generally discouraged and loops should sort you out well enough
~RM
why are they discouraged?if used correctly, they are really good in fail safes
also if you mean label(it would be best to use repeat or while-do in this case),
SCAR Code:var
c : integer;
label
here;
begin
here:
writeln('hello');
inc(c);
if c >= 5 then exit;
if not this then goto here;
end.
<TViYH> i had a dream about you again awkwardsaw
Malachi 2:3
Nah; Use this as fail safe!
pascal Code: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.
Verrekte Koekwous
There are currently 1 users browsing this thread. (0 members and 1 guests)