1
1
Fork 0
mirror of https://github.com/QB64-Phoenix-Edition/QB64pe.git synced 2024-06-29 11:40:38 +00:00
QB64-PE/internal/help/END.txt
SteveMcNeill 33adc04fc4 Add temp folder to repo. It's necessary as well!
Just more initial setting on... nothing much to see here.
2022-04-28 13:39:56 -04:00

54 lines
1.8 KiB
Plaintext

The [[END]] statement terminates a program without an immediate exit or ends a procedure or statement block.
{{PageSyntax}}
: [[END]] [{{Parameter|returnCode%}}]
: [[END]] [[IF...THEN|IF]]
: [[END]] [[TYPE]]
: [[END]] [[SELECT CASE|SELECT]]
: [[END]] [[SUB]]
: [[END]] [[FUNCTION]]
: END [[DECLARE LIBRARY|DECLARE]]
{{PageDescription}}
* In '''QB64''', [[END]] can be followed by a code that can be read by another module using the [[SHELL (function)|_SHELL]] or [[_SHELLHIDE]] function (known as [https://blogs.msdn.microsoft.com/oldnewthing/20080926-00/?p=20743 '''errorlevel'''])
* When END is used to end a program, there is a pause and the message "Press any key to continue..." is displayed at the bottom of the program's window.
* If the program does not use END or [[SYSTEM]], the program will still end with a pause and display "Press any key to continue...".
* In '''QB64''', [[SYSTEM]] will end the program immediately and close the window.
* The '''QB64''' [[_EXIT (function)]] can block a user's Ctrl + Break key presses and clicks on the window's close button (X button) until the program is ready to close.
{{PageExamples}}
''Example:'' In QB64 you won't return to the IDE unless you are using it to run or edit the program module.
{{CodeStart}} '' ''
{{Cl|PRINT}} "Hello world!"
{{Cl|END}}
{{Cl|PRINT}} "Hello no one!" '' ''
{{CodeEnd}}
''Returns:''
{{OutputStart}}
Hello world!
Press any key to continue...
{{OutputEnd}}
:''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, both in QBasic and in '''QB64'''.
{{PageSeeAlso}}
* [[SYSTEM]] {{text|(immediate exit)}}
* [[SHELL (function)]], [[_SHELLHIDE]]
* [[EXIT]] (statement), [[_EXIT (function)]]
{{PageNavigation}}
<