#81489 - 2003-01-29 03:39 PM
Re: Continue-Break in FOR-NEXT loops
|
Richard H.
Administrator
   
Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
|
Not a good idea, for two reasons.
1) In the example in my previous post, what you want to do is break out of two nested loops, both the "while" and the "do" loops. Of course you could have individual "Exit"s for each type of loop, but you are limiting it's functionality and usefulnes.
2) KiXtart is a free format language. "Exit" has an optional parameter. This means that given something a snippet of code like:
code:
Exit Do Until
or the equivalent
code:
Exit Do Until
The parser would have to make a decision about how to deal with the code. Is it an "Exit Do" with the "Until" being related to a "Do" encountered earlier in the script, or is it a solitary "Exit" followed by a Do/Until loop? It can be done, but it adds unnecessary complexity to the parser for no gain.
As an aside, I have always thought that the exit value for "Exit" and "Quit" should be mandatory, not optional. The syntax is a poor choice in a free format language, and I guess is a historical oddity.
|
|
Top
|
|
|
|
Moderator: Lonkero, ShaneEP, Jochen, Radimus, Glenn Barnas, Allen, Ruud van Velsen, Mart
|
0 registered
and 302 anonymous users online.
|
|
|