:= Operator

Assigns a value to a variable or property.

Syntax

variable [ := variable ]… := value

Parts

variable
A variable or property that you can change.
value
An expression of a data type compatible with variable.

Instructions

The element on the left side can be a scalar variable, a property, or an array element. The operator := assigns the value on its right to the variable or property on its left.

The operator := is almost the same as the operator = when used to assign a new value to a variable. The operator = can do one of two operations: (1) assign a value to a variable or (2) do a test for equality. But the operator := is for assignment only.

Note: The operator := is also used in procedure calls to pass arguments by name. See Passing Arguments by Position and by Name for more information.

Examples

Variable

The following code shows how a 3-D application can zero out its x, y, and z variables:

x := y := z := 0
After execution
variablevalue
x0
y0
z0

Property

' Change value property
#obj.value := 42

See also