Program termination: Difference between revisions
Content added Content deleted
Thundergnat (talk | contribs) m (syntax highlighting fixup automation) |
(add BQN) |
||
Line 392: | Line 392: | ||
<syntaxhighlight lang="bbcbasic">_@</syntaxhighlight> |
<syntaxhighlight lang="bbcbasic">_@</syntaxhighlight> |
||
The @ instruction ends the program. Some interpreters revert changes to the code (made by p) while others do not. |
The @ instruction ends the program. Some interpreters revert changes to the code (made by p) while others do not. |
||
=={{header|BQN}}== |
|||
<code>•Exit</code> immediately terminates the running BQN process. If the argument is a valid return code (on Unix, an integer), it is returned; otherwise, the default return code (the one returned when the end of the program is reached) is used. |
|||
We can use a block to create a conditional exit. Here we exit if the script is given zero command line arguments: |
|||
<syntaxhighlight lang="bqn">{ |
|||
0=≠•args ? •Exit 0; |
|||
•Show "has args" |
|||
}</syntaxhighlight> |
|||
=={{header|Bracmat}}== |
=={{header|Bracmat}}== |