3 Subroutines
steve-px edited this page 2026-07-07 10:59:34 +00:00

🢐🢐 Index🢐 Previous Page | Next Page 🢒


[-] Appendix A1 - Configuration Script Interpreter

Subroutines with #GOSUB and #RTS

Syntax

#GOSUB <Label>

#RTS

Description

#GOSUB (Go to Subroutine) transfers execution to a specified label within a configuration file. Control can be returned to the calling location by using the #RTS (Return from Subroutine) command.

#RTS (Return from Subroutine) returns execution from a subroutine to the point immediately following the corresponding #GOSUB command. It does this by restoring the program pointer to the most recent return address stored on the call stack, allowing script execution to continue where it left off.

Note: If #RTS is executed without a preceding #GOSUB, the Script Interpreter cannot determine a valid return address and will generate an error message in the console.

Examples

#GOSUB MyLabel 
(…) 
MyLabel: 
(…) 
#RTS   // Return to the #GOSUB and resume from there. 

🢐🢐 Index🢐 Previous Page | Next Page 🢒