Table of Contents

ugBASIC User Manual

EXIT ✓

SYNTAX

   EXIT [number]

PURPOSE

The instruction forces the program to leave a loop immediately, and it can be used to escape from all the types of loop, such as FOR…NEXT, REPEAT…UNTIL, WHILE…WEND and DO…LOOP.

When used on its own, EXIT will short-circuit the innermost loop only. By including a number after EXIT, that number of nested loops will be taken into account before the EXIT is made.

EXAMPLE

  EXIT
  EXIT 2

See also the following example files:

ABBREVIATION

 Ex

AVAILABLE ON

ANY PROBLEM?

If you have encountered a problem using this command, if you think there is a bug or the explanation is unclear, please open an issue for this keyword on GitHub. Thank you!

POWERED BY