xHarbour Reference Documentation > Function Reference xHarbour Developers Network  

FCount()

Returns the number of fields in the current work area.

Syntax

FCount() --> nFieldCount

Return

The function returns a numeric value which is the number of field variables available in a work area. If a work area is not used, the return value is zero.

Description

FCount() is used to determine how many fields, or field variables, exist in a work area. By default, the function operates in the current work area. Use an aliased expression to determine the number of fields in a different work area.

Info

See also:FIELD, FieldGet(), FieldName(), FieldType(), Type()
Category: File functions , Field functions
Source:rdd\dbcmd.c
LIB:xhb.lib
DLL:xhbdll.dll

Example

// The example shows a typical programming pattern for FCount() where
// an array is filled with the names and contents of all fields.

   PROCEDURE Main
      LOCAL aArray, n

      USE Customer NEW
      aArray := Array( FCount() )

      FOR n := 1 TO FCount()
         aArray[n] := { FieldName(n), FieldGet(n) }
      NEXT

      AEval( aArray, {|a| QOut( Padr(a[1],10)+":",a[2] ) } )

      USE
   RETURN

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