RDD

FieldPos()

Return the position of a field

Syntax

Signature
FieldPos( cFieldName ) --> nFieldPos

Arguments

cFieldName

Field name.

Return value

One-based field position, or zero when the name is not present.

Description

FieldPos() looks up a field name in the current work area's structure.

Notes

The lookup does not move the record pointer.

Example

FieldPos.prg
PROCEDURE Main()

   DbUseArea( .T., , "people.dbf", "People" )
   QOut( "NAME position: " + LTrim( Str( FieldPos( "NAME" ) ) ) )
   DbCloseArea()

RETURN

Output

See also