[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 FCOUNT()
 Return the number of fields in the current .dbf file
------------------------------------------------------------------------------
 Syntax

     FCOUNT() --> nFields

 Returns

     FCOUNT() returns the number of fields in the database file in the
     current work area as an integer numeric value.  If there is no database
     file open, FCOUNT() returns zero.

 Description

     FCOUNT() is a database function.  It is useful in applications
     containing data-independent programs that can operate on any database
     file.  These include generalized import/export and reporting programs.
     Typically, you use FCOUNT() to establish the upper limit of a FOR...NEXT
     or DO WHILE loop that processes a single field at a time.

     By default, FCOUNT() operates on the currently selected work area.

 Examples

     .  This example illustrates FCOUNT(), returning the number of
        fields in the current and an unselected work area:

        USE Sales NEW
        USE Customer NEW
        ? FCOUNT()                     // Result: 5
        ? Sales->(FCOUNT())            // Result: 8

     .  This example uses FCOUNT() to DECLARE an array with field
        information:

        LOCAL aFields := ARRAY(FCOUNT())
        AFIELDS(aFields)

     .  This example uses FCOUNT() as the upper boundary of a FOR loop
        that processes the list of current work area fields:

        LOCAL nField
        USE Sales NEW
        FOR nField := 1 TO FCOUNT()
           ? FIELD(nField)
        NEXT

 Files   Library is CLIPPER.LIB.


See Also: AFIELDS()* FIELDNAME() TYPE()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson