FieldPos Function (String) | |
Return the position of a field.
Namespace:
XSharp.RT
Assembly:
XSharp.RT (in XSharp.RT.dll) Version: 2.19
Syntax FUNCTION FieldPos(
cFieldName AS STRING
) AS DWORD
public static uint FieldPos(
string cFieldName
)
Request Example
View SourceParameters
- cFieldName
- Type: String
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, FieldPos() returns 0.
Remarks
FieldPos() is the inverse of the FieldName() function. FieldPos() 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 or by calling the overload that accepts a workarea
parameter (a workarea number or alias ).
Examples
This example demonstrates a typical specification of the FieldPos() function:
1USE customer NEW
2QOut(FIELDPOS("Name"))
3QOut(FieldGet(FIELDPOS("Name")))
This example uses FieldPos() to return the position of a specified field in a unselected work area:
1USE customer NEW
2USE invoices NEW
3QOut(Customer->FIELDPOS("Name"))
4QOut(Customer->FieldGet(FIELDPOS("Name")))
See Also