EXIT - QB64 Wiki

EXIT

From QB64 Wiki

Revision as of 22:45, 4 January 2012 by Clippy (Talk | contribs)
(diff) ← Older revision | Current revision (diff) | Newer revision → (diff)
Jump to: navigation, search

The EXIT statement is used to exit certain Qbasic procedures.


Syntax:

EXIT {DO|WHILE|FOR|SUB|FUNCTION|DEF}


Description:

  • EXIT leaves any of the following procedures immediately.
  • EXIT DO exits a DO...LOOP when called.
  • EXIT WHILE exits a WHILE...WEND loop when called.
  • EXIT FOR exits a FOR...NEXT counter loop when called.
  • 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 DEF exits a DEF FN function procedure before it ends. The value passed by the function's name should be defined.
  • 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 "Press any key to continue", use END.
  • To exit the program immediately you can use SYSTEM.


See also:



Navigation:
Go to Keyword Reference - Alphabetical
Go to Keyword Reference - By usage
Go to Main WIKI Page
Views
Personal tools