FCOUNT( ) Function

Returns the number of fields in a table.

FCOUNT([nWorkArea | cTableAlias])

Return Values

Numeric

Parameters

  • nWorkArea
    Specifies the work area of the table for which FCOUNT( ) returns the number of fields.

    FCOUNT( ) returns 0 if a table isn't open in the work area you specify.

  • cTableAlias
    Specifies the alias of the table for which FCOUNT( ) returns the number of fields.

    Visual FoxPro generates an error message if you specify a table alias that doesn't exist.

Remarks

If you omit the optional arguments, FCOUNT( ) returns the number of fields in the table open in the currently selected work area.

Example

CLOSE DATABASES
OPEN DATABASE (HOME(2) + 'Data\testdata')
USE customer  && Opens Customer table
SELECT 0
USE employee  && Opens employee table

CLEAR
? FCOUNT('CUSTOMER')     && Displays 13, # of fields in Customer 
? FCOUNT('EMPLOYEE')  && Displays 22, # of fields in Employee

See Also

DBF( ) | FIELD( ) | FSIZE( )