Subroutines and Functions

CommandDescription
Call statementBranches to an external subroutine. Call returns to the next statement, after the external subroutine executes a Return.
Declare statementDirects the compiler to recognize a call to a user-defined function or subroutine. Undeclared functions or subroutines will cause the compiler to abort.
Function statementEstablishes a procedure as a user-defined function so that it can return a value.
GoSub statementBranches to local subroutine. Returns to the following statement, when the subroutine terminates with a Return statement.
Return statementBranches back to calling statement + 1. If used from a function, Return can pass a value back to the calling stored procedure or event handler.
Subroutine statementEstablishes a procedure as a callable external subroutine.