EXIT: Difference between revisions
Jump to navigation
Jump to search
Navigation:
Main Page with Articles and Tutorials
Keyword Reference - Alphabetical
Keyword Reference - By usage
Report a broken link
(Created page with "The EXIT statement is used to exit certain QBasic procedures. {{PageSyntax}} : EXIT {DO|WHILE|FOR|SUB|FUNCTION|SELECT|CASE} {{PageDescription}} * 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. ** [...") |
No edit summary |
||
(3 intermediate revisions by the same user not shown) | |||
Line 20: | Line 20: | ||
{{PageAvailability}} | |||
* '''EXIT SELECT/CASE''' available | * '''EXIT SELECT/CASE''' available in: | ||
* All other variants available in all versions of QB64 | ** '''QB64 v1.5 and up''' | ||
** '''QB64-PE all versions''' | |||
* All other variants available in all versions of QB64 | |||
Latest revision as of 23:48, 10 January 2023
The EXIT statement is used to exit certain QBasic procedures.
Syntax
- EXIT {DO|WHILE|FOR|SUB|FUNCTION|SELECT|CASE}
Description
- 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.
- 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.
- To exit a program and allow the last program screen to be displayed with the message "Press any key to continue...", use END.
- To exit the program immediately, use SYSTEM.
Availability
- EXIT SELECT/CASE available in:
- QB64 v1.5 and up
- QB64-PE all versions
- All other variants available in all versions of QB64
See also