Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- CA-Clipper 5.3 . Guide To CA-Clipper - <b>fcount()</b> http://www.X-Hacker.org [<<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()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson