TeleFlow BasicScript Gosub
From TeleFlow
(Difference between revisions)
Wikilib (Talk | contribs)
(New page: The GOSUB keyword is used to create subroutines. The RETURN keyword is used to return from the subroutine to the command following the GOSUB that called the subroutine.<br> <br> ===Syntax=...)
Next diff →
Current revision
The GOSUB keyword is used to create subroutines. The RETURN keyword is used to return from the subroutine to the command following the GOSUB that called the subroutine.
Syntax
- GOSUB subroutine
- BasicScript statement(s)
- subroutine:
- RETURN
- subroutine: name chosen for the subroutine.
- Note that within the subroutine code, variables are referred to and affected as global variables. Exclusively global variables are available in this version of BasicScript.
Related Steps
Examples
BasicScript code
|
Result |
PRINT "start" GOSUB doitonce GOSUB doitonce
doitonce: PRINT "Hello" RETURN
|
start Hello Hello |
|
|
PRINT "end" GOTO final
doitonce: PRINT "Hello" RETURN
final: |
end |
