Click or drag to resize

FieldPutAlias Function

Set the value of a field identified by its work area alias and field name.

Namespace:  XSharp.RT
Assembly:  XSharp.RT (in XSharp.RT.dll) Version: 2.08
Syntax
 FUNCTION FieldPutAlias(
	symAlias AS SYMBOL,
	symField AS SYMBOL,
	uNewValue AS USUAL
) AS USUAL
View Source

Parameters

symAlias
Type: Symbol
The alias of 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 <symAlias>, FieldPutAlias() returns NIL.
Remarks
FieldPutAlias() allows you to set the value of a field using a symbol that specifies the field name.  Within generic database service functions, this allows the setting of field values without the use of the macro operator, among other things. By default, this function operates on the currently selected work area, as shown in the example below.  It can be made to operate on an unselected work area by specifying it within an aliased expression. Shared mode:  For a shared database, this function requires a record lock.  Refer to the "Concurrency Control" chapter in the Programmer's Guide for more information on locking.
Examples
This example uses FieldPutAlias() to set field values in two different work areas:
X#
USE region1 NEW
USE region2 NEW
FieldPutAlias(#REGION1, #FNAME, "Kate")
FieldPutAlias(#REGION2, #FNAME, "Cindy")
See Also