Operator = (assignment) Foundation
Simple assignment (binary): assigns a value to a variable.
<VarName> = <Expression>
The simple assignment operator (=) assigns a value to a variable. The expression <Expression> on the right side of the operator is evaluated and the value is assigned to the variable <VarName>.
The simple assignment operator (=) differs from the inline assignment operator in that it cannot be used within an expression. Within an expression the operator is interpreted as a comparison operator which tests whether two expressions are equal. The simple assignment operator cannot initialize variables within variable declarations (this is only possible with the inline assignment operator).
The variable may belong to any storage class. If the variable is a field variable, valid field variable data types depend on the active database engine (DBE). Values of the data types array, code block, object or NIL cannot be used with the DBFDBE engine. For DBFDBE, only values with the data type character, numeric, logical or date can be assigned to field variables.
When an undeclared variable <VarName> is referenced and no explicit alias name is used, it is considered by the compiler to be of storage class MEMVAR unless a field variable of the same name exists at runtime. If the variable does not exist at runtime, 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.