TeleFlow BasicScript Gosub
From TeleFlow
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 |
