Page 1 of 1 1
Topic Options
#133586 - 2005-02-10 04:10 PM New commands Exit loop
Sluice Offline
Fresh Scripter

Registered: 2001-11-13
Posts: 19
Loc: Romsey, England
I would like to see an EXIT FOR command that would enable me to exit a FOR..NEXT loop when a criterion is met, rather than have to run through a clunky count routine inside a WHILE...LOOP loop. What are the chances?
Top
#133587 - 2005-02-10 05:08 PM Re: New commands Exit loop
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Well, as this was requested some times before ... many times before ... the chances are growing somehow ... or not
_________________________



Top
#133588 - 2005-02-10 07:34 PM Re: New commands Exit loop
MightyR1 Offline
MM club member
*****

Registered: 1999-09-09
Posts: 1264
Loc: The Netherlands
Or use something like this:

Code:

for $i = 0 to 10
$i ?
if $i = 5
$i = 11
endif
next

_________________________
Greetz,
Patrick Rutten

- We'll either find a way or make one...
- Knowledge is power; knowing how to find it is more powerful...
- Problems don't exist; they are challenges...

Top
#133589 - 2005-02-11 09:36 AM Re: New commands Exit loop
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
Or cheat:
Code:

"Loop started"+@CRLF
$=Execute("

For $i = 1 To 10
'$$$i is now '+$i+@@CRLF
If $i=5 Exit For EndIf
Next

")
"Loop completed"+@CRLF




Top
#133590 - 2005-02-11 10:18 AM Re: New commands Exit loop
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
lol!

You basta
_________________________



Top
#133591 - 2005-02-11 01:15 PM Re: New commands Exit loop
Sluice Offline
Fresh Scripter

Registered: 2001-11-13
Posts: 19
Loc: Romsey, England
That's awesome, or is it awful?
Top
#133592 - 2005-02-11 02:53 PM Re: New commands Exit loop
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
roflmao - the "Exit For" thing is beautiful, gotta luv kix ! would "Exit 4" be equally ironic ?
Top
Page 1 of 1 1


Moderator:  Lonkero, ShaneEP, Jochen, Radimus, Glenn Barnas, Allen, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 483 anonymous users online.
Newest Members
M_Moore, BeeEm, min_seow, Audio, Hoschi
17883 Registered Users

Generated in 0.031 seconds in which 0.014 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org