REFERENCE
SetVar

This command is new in build 156

Many thanks to Olipcs for suggesting this command.

Sets the value of a runtime variable (and creates the variable if necessary).

Syntax

<SetVar name value>

Parameters

Name is the name of the variable.


Value is the value of the variable.


Remarks

SetVar can only be written inside a hotkey definition or user-defined command.

To create a variable, SetVar must be executed by pressing a hotkey or calling a user-defined command.

Once it's created, a variable is global to all hotkeys and commands that execute on the PC where you created it.

Values are treated as text.

Names and values are case-insensitive.

Variable names can be used only with this command and If statements.

Variables get destroyed when you load a script.

For debugging purposes, you can display all existing variables with DisplayVars.


Example

<Hotkey F1>
    <SetVar MyVar ValueOfMyVar>


Related topics

If
DisplayVars


This page was last revised on January 17, 2009.
 
INSTRUCTIONS


REFERENCE


WORLD OF WARCRAFT