Click or drag to resize

FieldPutArea Function

X#
Set the value of a field identified by its work area number and field name.

Namespace:  XSharp.RT
Assembly:  XSharp.RT (in XSharp.RT.dll) Version: 2.21
Syntax
 FUNCTION FieldPutArea(
	dwWorkArea AS DWORD,
	symField AS SYMBOL,
	uNewValue AS USUAL
) AS USUAL
Request Example View Source

Parameters

dwWorkArea
Type: DWord
The work area in which symField is located.
symField
Type: Symbol
The field name.
uNewValue
Type: Usual
The value to assign to the field.
The data type of this expression must match the data type of the field.

Return Value

Type: Usual
The value assigned to the field.
If symField does not correspond to any field in the work area specified by dwWorkArea, FieldPutArea() returns NIL.
Remarks
FieldPutArea() allows you to set the value of a field using a symbol that specifies the field name. Within generic database service functions this allows, among other things, the setting of field values without use of the macro operator. Shared mode:
For a shared database, this function requires a record lock.
Examples
This example uses FieldPutArea() to set field values:
X#
1USE sales NEW
2USE region1 NEW
3USE region2 NEW
4String2Symbol("FName")
5FieldPutArea(Select("region1"), #FNAME, "Kate")
6FieldPutArea(Select("region2"), #FNAME, "Cindy")
See Also