SBM AppScript Reference → Additional SBM AppScript Features → Including Scripts Within Scripts
You can use the $INCLUDE( scriptname ) tag to include scripts within scripts. This enables you to write utility scripts to use repeatedly within multiple SBM AppScripts. When the $INCLUDE( scriptname ) tag is found within a script, SBM fully expands the included script, parses the combined text, and then executes the script.
The following information pertains to the $INCLUDE( scriptname ) tag:
Include the name of the script as the argument for the $INCLUDE tag. The script name should be identical to the name provided when adding or editing a script in SBM Composer. The script name is case sensitive; it must match the name of the script with respect to the proper case.
If the script used in the $INCLUDE tag does not exist, the script fails.
You can only include a script once within a script. For example, if your main script includes $INCLUDE( script A ) twice, the first $INCLUDE( script A ) tag is expanded and executed; the second $INCLUDE( script A ) tag is replaced by a blank line.
The main script must be associated with an SBM context, but scripts called by the $INCLUDE tag should not be invoked separately within SBM.
It is a good practice to use the $INCLUDE( scriptname ) tag at the beginning or end of a main script and not within the main script.
To cancel script behavior, use the $$INCLUDE( scriptname).
Copyright © 2007–2017 Serena Software, Inc. All rights reserved.