Calling subroutines

Learn how to call subroutines in your script.

About this task

Calling subroutines is the act of running one or more subroutines you've created previously to run specific tasks. You can use the following commands to call subroutines:

Before you begin

The subroutine needs to exist. See how to create subroutines in Creating subroutines using Designer mode or Creating subroutines using Script mode.

Procedure

To call subroutines in your script, you need to use either the Run Subroutine (goSub), Run Subroutine If (gosubIf) or the Execute Subroutines (goSubs) command.

What to do next

You can return to a previous subroutine by using the Return from Subroutine (return) command in the subroutine you're currently running.