- Joined
- Sep 26, 2009
- Messages
- 9,521
Ever wonder what to do in JASS in place of a "continue" function in a loop? This used to bother me a few years ago but the solution is simple when you think of it.
Problem:
Solution:
Hope this inspires!
Problem:
JASS:
loop
//do stuff
if condition then
//continue
endif
//do stuff
exitwhen loopIsDone
endloop
Solution:
JASS:
loop
loop
//do stuff
if condition then
exitwhen true //continue
endif
//do stuff
if loopIsDone then
set exit=true
exitwhen true
endif
endloop
exitwhen exit
endloop
Hope this inspires!