Operator := Foundation
Inline assignment (binary): assigns a value to one or more variables.
<VarName> := <Expression>
The inline assignment operator (:=) assigns a value to one or more variables. The expression <Expression> on the right side of the operator is evaluated and the value is assigned to the variable <VarName>. The result of the operation is the assigned value.
The inline assignment operator differs from the simple assignment operator (=) in that it can be used to make an assignment within an expression. It can be used in a variable declaration to assign an initial value to a variable. Also, several variables can be assigned the same value in a single program line.
The variable may belong to any storage class. If the variable is a field variable, the data types which can be assigned to the field variable depends on the active data base engine (DBE). Note that values of data type array, code block, object or NIL cannot be assigned with DBFDBE. For DBFDBE, only values with the data type character, numeric, logical or date can be assigned to field variables.
When the variable <VarName> is referenced but is undeclared, and an explicit alias name is not used, it is considered by the compiler to be of storage class MEMVAR. If the variable does not exist, it is created at runtime as a PRIVATE variable.
If, at the time of assignment, both a field variable and an undeclared memory variable exist with the same name (the same symbol), the default behavior is to assign the value to the field variable. This default behavior can be changed by using the compiler switch /V.
If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.