anyone have a link to a tut on the continue command?
or can explain its use?
++ examples?
anyone have a link to a tut on the continue command?
or can explain its use?
++ examples?
AKA http://i105.photobucket.com/albums/m...uceSigcopy.jpg
I am a SCAR//SRL newb and i am willing to become better =) reading my tut's day by day.
K I believe (someone please correct me if I'm wrong) that it is kind of like repeating until the condition is opposite of what you have it.
EX.
SCAR Code:begin
repeat
WriteLn('will repeat this');
WriteLn('and this');
if (GetColor(420, 16)=15357184) then Continue; //it will continue doing this and EVERYTHING BEFORE IT until... the color is NOT 15357184
WriteLn('then will move on here');
until (false)
end.
Basically the command continue, When your repeating.... if you call continue it will skip the code.. and get to the next repeat...
SCAR Code:program new;
var i: Integer;
begin
for i:= 0 to 10 do
begin
if (i > 5) then Continue;
Writeln(inttostr(i));
end;
end.
Co Founder of https://www.tagcandy.com
Well actualy it just breaks out of the loop if I'm correctly, not really going to another loop, you have to be clear over here![]()
Because what I understood about what you've said was that it would skip out of the loop and goes to the next loop.. which is incorrect.
SCAR Code:program new;
var i, c: Integer;
begin
for i:= 0 to 10 do
begin
if (i > 5) then Continue;
Writeln(inttostr(i));
end;
Writeln('haha');
repeat
writeln('.');
inc(c);
until c>1
end.
This will also output the "haha", which means that it just breaks out of the loop.
I don't want to be the smartass() I just want to make things clear over tho the newcomers..
-Tsn.
P.S. Don't watch my english grammar, I know that that last sentence is wrong, but you should get what I mean![]()
[QUOTE=Santa_Clause;277761]I love you too TSN :p[/QUOTE]
[CENTER][URL="http://www.stats.srl-forums.com/sigs"][IMG]http://www.stats.srl-forums.com/sigs/1324.png[/IMG][/URL][/CENTER]
Co Founder of https://www.tagcandy.com
ummm..... then what is the correct usage?
AKA http://i105.photobucket.com/albums/m...uceSigcopy.jpg
I am a SCAR//SRL newb and i am willing to become better =) reading my tut's day by day.
You don't get me, damn I have to learn english![]()
You said that it goes to the other repeat, which is wrong, it will break out of the current one, not go to the other one.. that's my point
-Tsn.
EDIT; Let's show me by editing your script:
SCAR Code:program new;
var i, c: Integer;
begin
for i:= 0 to 10 do
begin
if (i > 5) then Continue;
Writeln(inttostr(i));
end;
Writeln('if it writes this, it means that it breaks out of the loop'+
', not go on with the other one, but the things between it aswell');
for c:=0 to 5 do
begin
if c>2 then Continue;
Writeln(inttostr(c));
end;
end.
You said that it goes to the other loop, which I understand from that it wouldn't do the things between the current loop and the next one, you get what I mean now?
[QUOTE=Santa_Clause;277761]I love you too TSN :p[/QUOTE]
[CENTER][URL="http://www.stats.srl-forums.com/sigs"][IMG]http://www.stats.srl-forums.com/sigs/1324.png[/IMG][/URL][/CENTER]
Continue restarts the loop.
Say you have a repeat function in a woodcutting script:
SCAR Code:repeat
if (FindTreeColor) then
Mouse(x,y,1,1);
if (FindEnt) then
continue;
until (TreeIsGone);
so if it found an ent it would go to the top of the loop and restart it.
There are currently 1 users browsing this thread. (0 members and 1 guests)