Command REPLACE Foundation
Assigns values to field variables.
REPLACE <cFieldname> WITH <Expression> ; [, <cFieldname> WITH <Expression>... ] ; [FOR <lForCondition>] ; [WHILE <lWhileCondition>] ; [NEXT <nCount>] ; [RECORD <xRecordID>] ; [REST] ; [ALL] ;
The file command REPLACE assigns values to specific field variables. After the key word REPLACE, a list of assignments can be specified (separated by commas) conforming to <Field1> WITH <Expr1>, <FieldN> WITH <ExprN>. The command has the same functionality as the assignment operator (:=). Of course, the variable referenced is always a field variable, even when no alias name is indicated with REPLACE. Values can also be assigned to field variables using the assignment operator when the alias name and alias operator are placed in front of the field name, or when the variable is explicitly declared as a field variable by the declaration FIELD.
When neither a condition nor the number of records are specified, REPLACE works with only the current record by default. Otherwise, the specified number of records or the records matching the condition are used.
In a multi-user application in a network operation, a record must be locked before the command REPLACE is executed or before an assignment occurs.
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.