Plug-ins User Guide
Version 5.2 | Published March 20, 2024 ©
DataPool Variables Scope
When referring to DataPool variables, the common and wide spread meaning is addressing global variables by their name and addressing structured variables by specifying the full path to the variable (i.e. <structure name>/../<variable name>).
In some DataPool plug-ins (where applicable), one of the parameters defines the DataPool variable scope. The options are Local and Global:
-
Local Variables: When referring to Local DataPool Variables, the meaning is variables within a DataPool object/data structure. When the scope is set to Local, the DataPool variable is addressed by its name only, even when it is a part of a DataPool structure.
-
Global Variables: When referring to Global DataPool Variables, the meaning is variables that are not defined as part of a DataPool structure.
Note: This parameter only has an effect on DataPool expressions and variables that reside under the DataObject container, i.e. child containers within the object’s hierarchy.
Example
The following definitions are set in the config.dp file:
string MyText;
MyObject{
string MyText;
string TextLength;
};
When addressing the variable MyText:
-
MyText="This Text"; → the Global variable MyText is set to This Text.
-
MyObject/MyText="This Text"; → The variable MyText in the MyObject structure is set to This Text.
When the scope parameter is set to Local and setting the following assignment in one of the structure’s children MyText="This Text"; then the effect is like defining the full path: MyObject/MyText="This Text";.