GoSub Command

The GoSub command is used to call subroutines. The calling format is

GoSub subname,#1,#2,...#n

where

Calling Options

For readability when compared to other languages, subroutines can be called by enclosing all arguments in parentheses and the GoSub command is optional. All these variations are equivalent:

GoSub subname,#1,#2,...#n
GoSub subname(#1,#2,...#n)
subname #1,#2,...#n
subname(#1,#2,...#n)

Notes

  1. Before versions 3.5/1.0, only the first calling option was allowed. Internal scripts using the new styles should require version 3.5/1.0 for use. To target older versions, all subroutine calls should be limited to the first style given above.
  2. When omitting the GoSub, the name of the subroutine must not match any built-in command.
  3. Only the first (or standard) calling method can use an expression for the subroutine name.