Difference between revisions of "Shell.exit"
From ComputerCraft Wiki
(Forgot some stuff) |
Bomb Bloke (Talk | contribs) |
||
(3 intermediate revisions by 3 users not shown) | |||
Line 2: | Line 2: | ||
{{Function | {{Function | ||
|name=shell.exit | |name=shell.exit | ||
− | |returns= | + | |returns=None |
|api=shell | |api=shell | ||
|addon=ComputerCraft | |addon=ComputerCraft | ||
− | |desc= | + | |desc=Causes the [[CraftOS|shell]] to terminate after the current script has finished execution, which will generally lead to the system shutting down. Note that it does ''not'' cause the currently executing script to exit. When using multiple tabs via [[multishell]], will only halt the shell in the current tab. Compare [[os.shutdown|os.shutdown()]], which causes an ''immediate'' system shutdown. |
|examples= | |examples= | ||
{{Example | {{Example | ||
− | |desc= | + | |desc=Current shell will exit once this code has finished execution. |
− | |code=shell.exit() | + | |code= shell.exit() |
+ | print("Press any key to exit shell...") | ||
+ | os.pullEvent("char") | ||
}} | }} | ||
}} | }} | ||
+ | |||
+ | [[Category:API_Functions]] |
Latest revision as of 01:56, 22 January 2015
Function shell.exit | |
Causes the shell to terminate after the current script has finished execution, which will generally lead to the system shutting down. Note that it does not cause the currently executing script to exit. When using multiple tabs via multishell, will only halt the shell in the current tab. Compare os.shutdown(), which causes an immediate system shutdown. | |
Syntax | shell.exit() |
Returns | None |
Part of | ComputerCraft |
API | shell |
Examples
Example | |
Current shell will exit once this code has finished execution. | |
Code |
shell.exit() print("Press any key to exit shell...") os.pullEvent("char") |