| xHarbour Reference Documentation > Function Reference |
![]() |
![]() |
![]() |
Retrieves the name of a field variable by its ordinal position.
FieldName( <nFieldPos> ) --> cFieldName
The function returns the name of the specified field variable as a character string, or a null string ("") if <nFieldPos> does not fall into the valid range.
FieldName() retrieves the name of a field variable by its ordinal position. 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: | DbFieldInfo(), DbStruct(), FCount(), FieldDec(), FieldGet(), FieldLen(), FieldPos(), FieldPut(), FieldType(), Type(), Valtype() |
| Category: | Database functions , Field functions |
| Source: | rdd\dbcmd.c |
| LIB: | xhb.lib |
| DLL: | xhbdll.dll |
// The example lists the names and values of all field variables
// in the current work area.
PROCEDURE Main
LOCAL n
USE Customer ALIAS Cust
FOR n:=1 TO FCount()
? Padr(FieldName(n),10),":",FieldGet(n)
NEXT
CLOSE Cust
RETURN
http://www.xHarbour.com