Smart Buttons
Controls/XML Elements

Variable <Variable>

The Variable element is a storage location paired with an associated symbolic name (variable name) that contains some known or unknown quantity of information referred to as a value.

Example of a variable with an unknown value:

Copy
<Variable VarName="CurrentPCC">%CurrentPcc%</Variable>

The value of variable CurrentPCC is taken from GDS Variable (%CurrentPcc%). Each time the script is run, it reads the active PCC.

Example of variable with known value:

Copy
<Variable VarName="PCC">73XV</Variable>

The value of the variable PCC is 73XV (a static value).

Configuring

To configure with Variable Editor:

  1. Open the Smart Buttons Editor to create a script.

  2. Click Variable <Variable> to display the Variable Editor.

  3. In Variable name, enter the symbolic name for variable that will be used in other controls. For example: CurrentPnr

  4. Optional. In Value, enter the default value of the variable.

  5. Optional. Select General storage to use this variable name and its value in any Smart Button script or any Smartpoint plugin.

  6. Click SUBMIT.

Using Variable Values

To use an existing variable as a value for a different XML element:

  1. Define the variable. For example:

    Copy
    <Variable VarName="CurrentPCC">%CurrentPcc%</Variable>
  2. Enter the variable name as a value of another XML element in square brackets. In this example, the variable is placed inside ShowMessage.

    1. Place the cursor where you want to enter your variable, then right-click to display a menu with defined variables.

    2. Select the desired variable to insert the variable in square brackets.

In this example, the script reads the current PCC and displays the PCC as a message.