SYSTEM: Difference between revisions

From QB64 Phoenix Edition Wiki
Jump to navigation Jump to search
(Created page with "The {{KW|SYSTEM}} statement immediately closes a program and returns control to the operating system. {{PageSyntax}} :'''SYSTEM''' [return_code%] {{Parameters}} * QB64 allows a ''code'' number to be used after SYSTEM to be read in another program module by the SHELL or _SHELLHIDE functions. ''Usage:'' * This command should be used to close a program quickly instead of pausing with END or nothing at all. * A code can be added after the statement to send...")
 
No edit summary
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
The {{KW|SYSTEM}} statement immediately closes a program and returns control to the operating system.  
The [[SYSTEM]] statement immediately closes a program and returns control to the operating system.




Line 6: Line 6:




{{Parameters}}
{{PageParameters}}
* QB64 allows a ''code'' number to be used after SYSTEM to be read in another program module by the [[SHELL]] or [[_SHELLHIDE]] functions.
* QB64 allows a ''code'' number to be used after SYSTEM to be read in another program module by the [[SHELL]] or [[_SHELLHIDE]] functions.


Line 17: Line 17:




''Qbasic or QuickBasic:''
''QBasic or QuickBASIC:''
* '''Qbasic BAS files can be run like compiled programs without returning to the IDE when [[SYSTEM]] is used to [[END|end]] them!'''
* '''QBasic BAS files can be run like compiled programs without returning to the IDE when [[SYSTEM]] is used to [[END|end]] them!'''
* If a program BAS module is run from the IDE, stopped by Ctrl-Break or an error occurs the QB program will exit to the IDE.
* If a program BAS module is run from the IDE, stopped by Ctrl-Break or an error occurs the QB program will exit to the IDE.
* To run a QuickBasic program without the IDE use the following DOS command line: {{text|QB.EXE /L /RUN filename.BAS|green}}
* To run a QuickBASIC program without the IDE use the following DOS command line: {{Text|QB.EXE /L /RUN filename.BAS|green}}




{{PageSeeAlso}}
{{PageSeeAlso}}
* [[SHELL (function)]]
* [[SHELL (function)]]
* [[_SHELLHIDE]] {{text|(function)}}
* [[_SHELLHIDE]]
* [[_EXIT (function)]], [[END]]
* [[_EXIT (function)]], [[END]]




{{PageNavigation}}
{{PageNavigation}}

Latest revision as of 22:52, 11 February 2023

The SYSTEM statement immediately closes a program and returns control to the operating system.


Syntax

SYSTEM [return_code%]


Parameters

  • QB64 allows a code number to be used after SYSTEM to be read in another program module by the SHELL or _SHELLHIDE functions.


Usage:

  • This command should be used to close a program quickly instead of pausing with END or nothing at all.
  • A code can be added after the statement to send a value to the SHELL (function) or _SHELLHIDE function in another module.
  • SYSTEM ends the program and closes the window immediately. The last screen image may not be displayed.


QBasic or QuickBASIC:

  • QBasic BAS files can be run like compiled programs without returning to the IDE when SYSTEM is used to end them!
  • If a program BAS module is run from the IDE, stopped by Ctrl-Break or an error occurs the QB program will exit to the IDE.
  • To run a QuickBASIC program without the IDE use the following DOS command line: QB.EXE /L /RUN filename.BAS


See also



Navigation:
Main Page with Articles and Tutorials
Keyword Reference - Alphabetical
Keyword Reference - By usage