Exit

From EDukeWiki
Revision as of 05:11, 7 January 2024 by Doom64hunter (talk | contribs) (Created page with "The '''exit''' command breaks out of a loop, in the way one would normally from "break" commands in other languages. It should not be used outside of loops. It should be used instead of break if the intention is to actually leave the loop early. See also continue, return and terminate. == Example == set j 0 whilen j 3 { add j 1 userquote 500 exit userquote 400 } Makes quote 500 be displayed exactly once...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

The exit command breaks out of a loop, in the way one would normally from "break" commands in other languages. It should not be used outside of loops.

It should be used instead of break if the intention is to actually leave the loop early.

See also continue, return and terminate.

Example

   set j 0
   whilen j 3
   {
       add j 1
       userquote 500
       exit
       userquote 400
   }

Makes quote 500 be displayed exactly once, and quote 400 not a single time.