| xHarbour Reference Documentation > Function Reference |
![]() |
![]() |
![]() |
Retrieves the value of a field variable by its ordinal position.
FieldGet( <nFieldPos> ) --> xFieldValue
The function returns the value of the field variable at the specified position, or NIL if <nFieldPos> does not fall into the valid range.
FieldGet() retrieves the value of a field variable by its ordinal position, rather than by its field name. The ordinal position is determined by the sequence of field declarations when a database file is created. Ordinal positions begin with 1 and end with FCount().
| See also: | FieldBlock(), FieldName(), FieldPut(), FieldWBlock() |
| Category: | Database functions , Field functions |
| Source: | rdd\dbcmd.c |
| LIB: | xhb.lib |
| DLL: | xhbdll.dll |
// The example calls FieldGet() in the current work area
// and in a different work area using an aliased expression.
PROCEDURE Main
USE Customer ALIAS Cust
// current work area
? FieldPos( "Lastname" ) // result: 3
? FieldGet(3) // result: Miller
SELECT 0 // new work area
? Used() // result: .F.
? FieldGet(3) // result: NIL
// aliased expression
? Cust->(FieldGet(3)) // result: Miller
CLOSE Cust
RETURN
http://www.xHarbour.com