Difference between revisions of "END"

From QB64 Wiki
Jump to navigation Jump to search
imported>Clippy
m
imported>Clippy
m
Line 15: Line 15:
  
  
* An optional ''return code'' can be read in another module using the [[_SHELL (function)|_SHELL]] or [[_SHELLHIDE]] function in '''QB64 only'''.
+
* In '''QB64''' END can be followed by a code that can be read in another module using the [[SHELL (function)]] or [[_SHELLHIDE]] function.
 
*"Press any key to continue..." is displayed in a program after [[END]] is used in a program.  
 
*"Press any key to continue..." is displayed in a program after [[END]] is used in a program.  
 
*If the program does not use END or [[SYSTEM]] the results are the same as using END.
 
*If the program does not use END or [[SYSTEM]] the results are the same as using END.
 
*In '''QB64''' [[SYSTEM]] will end the program immediately and close the window.
 
*In '''QB64''' [[SYSTEM]] will end the program immediately and close the window.
 
*The '''QB64''' [[_EXIT (function)]] can block a user's Ctrl + Break key press or click on the window X box until the program is ready.
 
*The '''QB64''' [[_EXIT (function)]] can block a user's Ctrl + Break key press or click on the window X box until the program is ready.
* In '''QB64''' END can be followed by a code that can be read in another module using the [[SHELL (function)]] or [[_SHELLHIDE]] function.
 
 
*When running a Qbasic BAS module from the command line, use [[SYSTEM]] to avoid returning to the [[IDE]].
 
*When running a Qbasic BAS module from the command line, use [[SYSTEM]] to avoid returning to the [[IDE]].
  

Revision as of 16:47, 19 April 2012

The END statement terminates a program without an immediate exit or ends a procedure or statement block.


Syntax

END
END IF
END TYPE
END SELECT
END SUB
END FUNCTION

QB64 == Syntax ==

END [return_code%]
END DECLARE


  • In QB64 END can be followed by a code that can be read in another module using the SHELL (function) or _SHELLHIDE function.
  • "Press any key to continue..." is displayed in a program after END is used in a program.
  • If the program does not use END or SYSTEM the results are the same as using END.
  • In QB64 SYSTEM will end the program immediately and close the window.
  • The QB64 _EXIT (function) can block a user's Ctrl + Break key press or click on the window X box until the program is ready.
  • When running a Qbasic BAS module from the command line, use SYSTEM to avoid returning to the IDE.


Example: In QB64 you won't return to the IDE unless you are using it to run or edit the program module.

PRINT "Hello world!" END PRINT "Hello no one!"

Returns:

Hello world! Press any key to continue...

Explanation:"Hello no one!" isn't returned because the program ended with the END statement no matter what is after that.
The message "Press any key to continue..." is displayed after the program ends in QB or QB64.


See also



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