GOSUB
From STX Wiki
Jump to navigationJump to search
GOSUB subrlabel [arguments]
Call the local subroutine at subrlabel label. The subroutine will get a copy of the current execution environment, meaning that it can "see" all current variables, but that any changes to them will be local to the subroutine. So, there is no danger of the subroutine changing the caller's variable environment - but there is also no way of doing this intentionally. Don't forget to finish your subroutine with an appropriate EXIT statement.
Note that if you really, really must change the variables of the caller, you may use the GOSUBX
statement.