Navigation:  Using Visual Build > Panes > Step Panes >

Global Subroutine Steps Pane

Previous pageReturn to chapter overviewNext page

The Global Subroutine Steps pane is where global subroutines are defined.  Global subroutines can be very useful for modularizing code across multiple projects.  If there are common steps that needs to be used across multiple projects, you can place them in a global subroutine and call them from each project.  By default, global subroutine steps are loaded/saved from/to the VisBuildPro.steps file in the configuration files path.  Global subroutine steps are saved to disk whenever a project is saved or the GUI application is closed.

 

A subroutine is defined as any step (other than a Subroutine Call action step) at the main level (no indentation) of the Global Subroutines pane, and it is comprised of that step and any child steps (indented below that step).  Each subroutine should be given a unique name; if two subroutines with the same name are defined, the first one will be called.

 

To call a subroutine, add a step with the Subroutine Call action to your project.  The custom action screen for this action allows the selection or entry of a subroutine step name, and the entry of up to several temporary macros to be defined and passed to the subroutine.  Subroutine steps can reference any available macro name, not just those defined in this list, but this provides a convenient way to quickly define any macros to pass to the subroutine steps.

 

Subroutine steps can be called from Project steps, Failure steps, or project Subroutine steps, or another Global subroutine.  Project subroutines will always be searched first for a matching subroutine name, and if not found the global subroutines will be searched (this allows global subroutines to be overridden by a project subroutine of the same name).  When a subroutine returns, all the temporary macros defined for calling that subroutine will be deleted, so be sure to use unique parameter names across subroutines when one subroutine calls another subroutine.