SRL Archive - OSR Help

Forcing a "For" function to stop abrutly


Xtensity

2010-02-11 15:52:13

Basically I'm using TPAs, and moving mouse fast to all found points, but how do I make it stop in the middle of the For function if it's found what it's looking for….like if rs_GetUpText was what I was looking for?

MylesMadness

2010-02-11 15:59:04

break; ?

Blumblebee

2010-02-11 16:04:21

for i := 0 to 99 do
begin
if BooleanIsTrue then
begin
insertstuffhere;
break; // breaks the for..do loop.
end;
end;

Xtensity

2010-02-11 16:06:53

Yeah just figured it out in basic tutorial the moment i posted this lol :P


It's always the extreme basic crap I have problems with, most of the advanced stuff is easy :P

jimthesoundman

2010-02-11 16:43:47

What is the difference between break and exit?

Frement

2010-02-11 16:45:16

From: jimthesoundman
What is the difference between break and exit?


Exit; exits the function.
Break; breaks the loop but continues function.

Wanted

2010-02-11 16:50:40

From: jimthesoundman
What is the difference between break and exit?


One gets out of the loop that it is in, Two leaves the entire function or procedure.

procedure One;
begin
repeat
Break;
until (True);
WriteLn('Jump here');
end;

procedure Two;
begin
repeat
Exit;
until (True);
WriteLn('Won''t jump here');
end;

begin
One;
Two;
end.