Script Result
CATEGORY: Scripting
CLASS: Technique
As you know, one script can call upon another script with the Perform Script Step. In most discussions, the original script is called the parent or source script. The script that was called upon from the source script is called the subscript.
A Script Result is a calculation can be returned back as a result from a sub-script via the “Exit” script step. This means that data that was captured or variables that were set can be passed from a subscript back to the script that called upon it. The Exit Script step is used for this. Many times, this is used within a branch in the subscript. This is useful if you have a subscript that might be called upon by many different subscripts for diverse reasons.
The Get(ScriptResult) function allows the source script to see data that was passed back to it from the subscript. I have to admit, I’ve never used this technique but understand its power. I just haven’t mapped my mind to think in this direction. I have worked with developers that do this all the time. It is not uncommon for the most experienced developer to take a little time to get on board with a new technique. The process of using Script Results is very powerful and flexible.
ADVERTISEMENT ==================
Help support this blog by considering a donating to its ongoing growth. For more details, please visit http://www.dwaynewright.com/donate.html