GetVariableValue Text Query Command

Gets the string value of a variable. New in 5.0.3.4.

varvalue = GetVariableValue ([STYLEVAR document:...-varname])


Parameters:
stylevar/s is the name of the variable to query.

Results:
returns the string value of the variable specified.

Notes:


See Also:
DeleteVariable, GetVariables, GetVariableValue, InsertName, NewVariable, SetVariableName, SetVariableValue

Examples:
Python:


ARexx:

Applescript:

 

GetVariableValue  Command Definition  url:PGScmd/getvariablevalue
  created:2006-06-03 10:15:03   last updated:2006-09-06 12:10:12
  Copyright © 1985-2017 GrasshopperLLC. All Rights Reserved.

User Contributed Comments For GetVariableValue
Tim Doty wrote...2007-05-08 14:03:08

The command declaration is incorrect, it should be:

varvalue = GetVariableValue([VARIABLE/s variable])

If the variable is not specified it will retrieve the current variable. If there is none it will return '0' in '.result'.

Code:

>>> NewVariable('my_var', 'some_value')
>>> print GetVariableValue('VARIABLE', 'my_var')['.result']
some_value

Note: the example is one of the cases where the variable does not need to be specified. However, to avoid unnecessary hair pulling it is recommended to always specify the variable.

User Contributed Comments For GetVariableValue