Previous Topic: Set Variables to a Particular Value

Next Topic: Complex Variables in Assignment Statements

Explicit Assignment: Assignment Statement

The basic format of the assignment statement is:

&variable = expression
&variable

Is the name of the user variable or global variable whose value is to be changed. The variable might not actually exist, in which case the assignment statement creates it then sets its value.

The name of the variable must be valid according to the rules for variable names.

If a system variable is specified as the target of an assignment statement a syntax error will occur.

Complex variables are supported.

=

Is written as shown, indicating that an assignment is required.

expression

Represents the value that is to be assigned to the target variable. If no expression is supplied the target variable is assigned a null value, and the variable is automatically deleted. An expression is one of the following constructs: