xHarbour Reference Documentation > Function Reference xHarbour Developers Network  

FieldName()

Retrieves the name of a field variable by its ordinal position.

Syntax

FieldName( <nFieldPos> ) --> cFieldName

Arguments

<nFieldPos>
A numeric value specifying the ordinal position of the field variable to query. Valid values are in the range from 1 to FCount().

Return

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.

Description

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().

Info

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

Example

// 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

Copyright © 2006-2007 xHarbour.com Inc. All rights reserved.
http://www.xHarbour.com
Created by docmaker.exe