WiseScript Editor Reference
28
Variables and Expressions
Variables
Variables are named storage locations that hold information about the system,
information entered by the end user, or information derived or calculated from either of
these sources. You can define up to 400 variables using the Set Variable action. You can
then gather data from the end user or read data from files to put into variables.
Variables hold ASCII text, not binary data. They can be up to 32 KB in length.
Variable Naming Conventions
z
Must begin with a letter.
z
Must be 28 characters or less.
z
Cannot begin with an underscore character; only compiler variables can start with
an underscore character.
z
Cannot contain % characters, except when using substitution as described below.
Variables and Substitution
By using variables, the installation .EXE can adapt to each destination computer. Once
information is stored in a variable, it can be used in most script actions through a
process called substitution. Any parameter for a script action can get part or all of its
value from a variable.
To use substitution, specify the variable name preceded and followed by %. (Examples:
%WIN% refers to the contents of the WIN variable, which is the path to the Windows
system directory, and %WIN%\Fonts refers to the path to the Windows font directory.)
The % character is not part of the variable name, but rather a marker that tells
WiseScript to replace the variable’s name with its value before executing the command.
To include an actual % character in the script, use %%.
You can use substitution to:
z
Build messages to display to the end user.
z
Set locations for copying or installing files.
z
Initialize new variables to the value of one or more other variables.
Expressions
z
If you are using a variable name as part of an expression, do not surround the
variable name with % characters. (Example: When you use an If, ElseIf, While, Set
Variable, or a Wizard Loop action to evaluate an expression, do not surround the
variables you reference in the expression with %.)
z
Do surround compiler variables with % characters no matter where you enter them.
Some actions (If, While, Set Variable, and some others) can use a more flexible scheme
that lets you use arithmetic expressions and other options.
See
Expression Operators
on page 137.
To read about sample scripts that use expressions, see ScriptHelp.htm in the Samples
subdirectory of this product’s installation directory and find scripts that manipulate
strings and perform calculations.
Summary of Contents for ALTIRIS INVENTORY 7.0 SP2 - FOR NETWORK DEVICES V1.0
Page 1: ...WiseScript Editor Reference ...
Page 31: ...WiseScript Editor Reference 31 ...
Page 91: ...WiseScript Editor Reference 91 ...
Page 148: ...WiseScript Editor Reference 148 ...