= Operator

Language Items List

Definition:

The assignment operator used to assign values to variables or properties.

Syntax:

Syntax Description


expression Value assigned to the variable. It can be any string or numeric expression.

Details:

The equal sign specifies that the named variable or property is given the value of the expression listed to the right of the equal sign. The value expression and the variable or property must have compatible data types. This means you cannot assign a value of type String to a variable or property of type numeric or vice-versa or a type mismatch program exception is thrown, if the needed type cannot be extracted from the given type.

If the value expression and the variable or property have different but compatible data types, Phoenix automatically converts the value to the type of the named variable or property. For example, if the expression is Long and the receiving variable is an Integer, it is converted to Integer, the numeric data type of the named variable.

To extend an assignment to the properties of all objects inheriting the assigned property, use a variation of the assignment = Operator, called the "Deep-Set" operator. The
deep-set operator uses the colon (:) character to indicate that the extended assignment is intended.

See Also:

Assignment Operators

:= Operator

Example:

Dim intVar As Integer
intVar =
123 : print intVar -> 123