Click or drag to resize

FieldPosSym Function

X#
Return the position of a field that is identified by a symbol.

Namespace:  XSharp.RT
Assembly:  XSharp.RT (in XSharp.RT.dll) Version: 2.19
Syntax
 FUNCTION FieldPosSym(
	sFieldName AS SYMBOL
) AS DWORD
Request Example View Source

Parameters

sFieldName
Type: Symbol
A symbol that corresponds to the name of the field.

Return Value

Type: DWord
The position of the specified field within the list of fields associated with the work area.
If the work area has no field with the specified name, FieldPosSym() returns 0.
Remarks
FieldPosSym() is the inverse of the FieldName() function. FieldPosSym() is most often used with the FieldPut() and FieldGet() functions. 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
Examples
This example demonstrates a typical specification of the FieldPosSym() function:
X#
1USE customer NEW
2QOut(FieldPosSym(#Name))                // Result: 1
3QOut(FieldGet(FieldPosSym(#NAME)))            // Result: Kate
This example uses FieldPosSym() to return the position of a specified field in a unselected work area:
X#
1USE customer NEW
2USE invoices NEW
3QOut(Customer->FieldPosSym(#Name))            // Result: 1
4QOut(Customer->FieldGet(FieldPosSym(#Name)))    // Result: Kate
See Also