MSM-Workstation
Macros

Go back to the alphabetic list of macros
Go back to the first page of this tutorial

%%SetVar ( TiedVariable [ , Value ] )

Update the value displayed in a control on a window by referring its local variable.

TiedVariable A local variable tied to a control on a window.

Value An optional expression yielding a value to assign to the variable.

The macro %%SetVar is used to refer to controls by means of local variables associated with the control via the VarName property. If a Value parameter is specified, the TiedVariable is set to Value; otherwise the value already in TiedVariable is used. The name of the variable specified by TiedVariable is used to look up the runtime window and control to which it refers, and the property Value of that control is set, causing the display to be updated.

Examples

%%SetVar(TESTNO)
Set the control associated with local variable TESTNO to the value held by variable TESTNO.

%%SetVar(MAX,10)
Set local variable MAX to the value 10, then set the value of the control associated with local variable MAX to the same value.

See also

%%GetVar and %%ResetVar.