IBM Support

Using global variables in IBM\Rational Robot® scripts to carry data across multiple scripts during a single run

Troubleshooting


Problem

Users may want to gather information in one script and use the information in subsequent scripts.

Resolving The Problem

Use of a global variable is only possible when the scripts are all run at the same time as part of a shell script. The data is only kept during a single run. To implement a global variable in a run using a shell script:

1. Add a declaration statement to the global.sbh file for your project. The typical declaration statement for a global variable looks something like this:

Global variableName As typeName

2. The GUI Shell Script and each member script must have the '$Include "global.sbh" statement at the top of the script so that the global variable will be visible.

3. The shell script and each member script can read and write to this variable. No variable declarations need to be included in the scripts themselves as this is done in the header file.





[{"Product":{"code":"SSSHDX","label":"Rational Robot"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"Scripting","Platform":[{"code":"PF033","label":"Windows"}],"Version":"2003;2003.06.00;2003.06.12;2003.06.13;2003.06.14;2003.06.10","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}}]

Document Information

Modified date:
16 June 2018

UID

swg21213511