The exit do
, exit for
, and exit while
statements work inside of their respective loops.
It causes the loop to exit immediately, and execution continues with the next statement following the loop.
There are no arguments.
Typically, you would use an if
statement to decide whether to exit or not.
The following example reads lines of input from the user until they enter a blank line.
dim line as String
if Len(line) = 0 then exit while