Set the value of a field identified by its position.
XSharp.RT (in XSharp.RT.dll) Version: 2.18
Syntax Request Example
nFieldPos AS USUAL,
uNewValue AS USUAL
) AS USUAL
public static Usual FieldPut(
- Type: Usual
The position of the field in the database file structure.
- Type: Usual
The value to assign to the field.
The data type of this expression must match the data type of the field.
The value assigned to the field.
does not correspond to the position of any field in the database file, FieldPut() will generate an error.
The exception to this is the XBase++ dialect where an invalid nFieldPos
will not generate an exception but will return NIL.
FieldPut() allows you to set the value of a field using its position within the database file structure rather than its field name. Within generic database service functions this allows, among other things, the setting of field values without use of the macro operator.
Note: FieldPut() can be used with a BLOB field (that is, a memo field associated with a BLOB file), provided the length of the field does not exceed 64 KB.
By default, this function operates on the currently selected work area.
It can be made to operate on an unselected work area by specifying
it within an aliased expression
For a shared database, this function requires a record lock.
This example compares FieldPut() to functionally equivalent code that uses the macro operator to set the value of a field:
2FName := FIELDNAME(nFieldPos)
3_FIELD->&FName := FVal