1
1
Fork 0
mirror of https://github.com/QB64-Phoenix-Edition/QB64pe.git synced 2024-07-01 15:00:38 +00:00
QB64-PE/internal/help/EXIT.txt

35 lines
1.3 KiB
Plaintext
Raw Normal View History

2017-10-10 14:55:21 +00:00
The [[EXIT]] statement is used to exit certain QBasic procedures.
{{PageSyntax}}
2021-01-04 18:45:32 +00:00
: [[EXIT]] {DO|WHILE|FOR|SUB|FUNCTION|SELECT|CASE}
{{PageDescription}}
2017-10-10 14:55:21 +00:00
* [[EXIT]] leaves any of the following procedures immediately.
** [[EXIT]] DO exits a [[DO...LOOP]].
** [[EXIT]] WHILE exits a [[WHILE...WEND]] loop.
** [[EXIT]] FOR exits a [[FOR...NEXT]] counter loop.
** [[EXIT]] SUB exits a [[SUB]] procedure before it ends. Use before any [[GOSUB]] procedures using [[RETURN]].
** [[EXIT]] FUNCTION exits a [[FUNCTION]] procedure before it ends. The value passed by the function's name should be defined.
2021-01-04 18:45:32 +00:00
** [[EXIT]] SELECT exits a [[SELECT CASE]] block.
** [[EXIT]] CASE does the same as EXIT SELECT unless when used in a '''SELECT EVERYCASE''' block; in such case, execution proceeds to the next CASE evaluation.
* EXIT statements normally use an [[IF...THEN]] statement to evaluate a program condition that would require the EXIT.
2019-04-15 01:15:33 +00:00
* To exit a program and allow the last program screen to be displayed with the message "Press any key to continue...", use [[END]].
2017-10-10 14:55:21 +00:00
* To exit the program immediately, use [[SYSTEM]].
== Availability ==
* '''EXIT SELECT/CASE''' available with v1.5.
2021-01-04 18:45:32 +00:00
* All other variants available in all versions of QB64.
{{PageSeeAlso}}
* [[_EXIT (function)]]
* [[END]], [[SYSTEM]]
* [[STOP]]
2019-04-15 01:15:33 +00:00
{{PageNavigation}}
<