Function FieldPos() Foundation
Returns the position of a field in a work area.
FieldPos( <cFieldName> ) --> nFieldPosition
The return value of FieldPos() is an integer containing the position of the field named <cFieldName> within the work area. When <cFieldName> is not a valid field name in the work area, the value zero is returned.
The database function FieldPos() returns the position of an individual field within a record of a work area. If the function is used without the alias operator, the field position from the current work area is returned. The counterpart of FieldPos() is the function FieldName() which returns the name of the field in the record from the field position.
The function FieldPos() is frequently used with FieldGet() and FieldPut(). For example, this is done in programming generic read and write functions which operate without knowledge of the underlying data structure.
If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.