Stop (statement): Difference between revisions
(Created page with "The '''STOP''' (ST) statement ends Business Rules, closes all files, and resets the value of the CODE function. ===Comments and Examples=== STOP is an optional statement....") |
(→Syntax) |
||
(5 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
The '''STOP''' (ST) statement ends | The '''STOP''' (ST) statement ends the program and closes all files, and can also be used to reset the value of the [[CODE]] function. | ||
===Comments and Examples=== | ===Comments and Examples=== | ||
STOP is an optional statement. When STOP is not specified, the system automatically ends a program after the last line in the program and sets the value of CODE to 0. In the following example, STOP indicates the end of the program and sets the value of CODE to 1: | STOP is an optional statement. When STOP is not specified, the system automatically ends a program after the last line in the program and sets the value of CODE to 0. In the following example, STOP indicates the end of the program and sets the value of CODE to 1: | ||
00130 STOP 1 | 00130 STOP 1 | ||
The STOP statement is useful to end a program before it tries to run [[GOSUB]]s, functions, or other lines that are placed outside the main body of the program for reference from earlier in the program. | |||
===Syntax=== | ===Syntax=== | ||
STOP [<[[numeric expression]]>] | |||
[[file:Stop.png]] | [[file:Stop.png]] | ||
Line 13: | Line 16: | ||
===Parameters=== | ===Parameters=== | ||
"Num-expr" is an optional parameter that sets the value of the CODE variable. | "Num-expr" is an optional parameter that sets the value of the CODE variable. | ||
See the [[END]] statement and the [[CODE]] function for information about uses of | See the [[End|END]] statement and the [[CODE]] function for information about uses of | ||
CODE. See also the [[CHAIN]] statement to end a program by starting another program or procedure. | CODE. See also the [[Chain|CHAIN]] statement to end a program by starting another program or procedure. | ||
<noinclude> | |||
[[Category:Statements]] | |||
[[Category:Ending Programs Statements]] | |||
</noinclude> |
Latest revision as of 00:11, 6 May 2014
The STOP (ST) statement ends the program and closes all files, and can also be used to reset the value of the CODE function.
Comments and Examples
STOP is an optional statement. When STOP is not specified, the system automatically ends a program after the last line in the program and sets the value of CODE to 0. In the following example, STOP indicates the end of the program and sets the value of CODE to 1:
00130 STOP 1
The STOP statement is useful to end a program before it tries to run GOSUBs, functions, or other lines that are placed outside the main body of the program for reference from earlier in the program.
Syntax
STOP [<numeric expression>]
Default
1.) Set CODE to 0.
Parameters
"Num-expr" is an optional parameter that sets the value of the CODE variable. See the END statement and the CODE function for information about uses of CODE. See also the CHAIN statement to end a program by starting another program or procedure.