Use break to exit from a loop.
syntax:
break
Example using the break statement |
(= GAME_RUNNING TRUE)
(while(1)
/* while(1) causes an infinate loop */
(self:doit())
(if(
not GAME_RUNNING)
break /* if GAME_RUNNING
== FALSE, the loop will stop */
)
)
|
see also: do
while, while, for
|