Programmer Guide/Command Reference/GOSUB: Difference between revisions

From STX Wiki
Jump to navigationJump to search
No edit summary
No edit summary
 
(4 intermediate revisions by the same user not shown)
Line 3: Line 3:
Call the local subroutine at <var>subrlabel</var> label. Calling a local subroutine is like starting a new macro, but the execution begins at the label subrlabel and not with the first line of the macro code. The subroutine will get an own execution environment and an own local variable space. Use the command [[Programmer_Guide/Command_Reference/EXIT|EXIT]] to end the subroutine and to return a result to the caller.
Call the local subroutine at <var>subrlabel</var> label. Calling a local subroutine is like starting a new macro, but the execution begins at the label subrlabel and not with the first line of the macro code. The subroutine will get an own execution environment and an own local variable space. Use the command [[Programmer_Guide/Command_Reference/EXIT|EXIT]] to end the subroutine and to return a result to the caller.


Note: The command [[Programmer Guide/Command Reference/GOSUBX|GOSUBX]]</code> works like this command, but the called subroutine uses the same ''local variable environment'' as the caller.
Note: The command [[Programmer Guide/Command Reference/GOSUBX|GOSUBX]] works like this command, but the called subroutine uses the same ''local variable environment'' as the caller.


See also:
See also:
[[Programmer Guide/Command Reference/GOTO]],
[[../GOTO|GOTO]], [[../DISPATCH|DISPATCH]], [[../MACRO|MACRO]]
[[Programmer Guide/Command Reference/DISPATCH]],
[[Programmer Guide/Command Reference/MACRO]]

Latest revision as of 09:55, 25 January 2016

GOSUB subrlabel [arguments]

Call the local subroutine at subrlabel label. Calling a local subroutine is like starting a new macro, but the execution begins at the label subrlabel and not with the first line of the macro code. The subroutine will get an own execution environment and an own local variable space. Use the command EXIT to end the subroutine and to return a result to the caller.

Note: The command GOSUBX works like this command, but the called subroutine uses the same local variable environment as the caller.

See also: GOTO, DISPATCH, MACRO

Navigation menu

Personal tools