PA_CountFields


version 2003


PA_CountFields (tableNum) → short

Parameter Type Description
tableNum short Table number
Function result short Number of fields in the table tableNum

Description

The command PA_CountFields returns the number of fields in the table tableNum .

Please note that this routine works only with tables. You cannot get the number of fields of a subtable using this routine.

Example

Count all fields of the database, except subtables fields.

   short CountAllFieldsButSubtables ()
   {
      short   countTables, count, i;
 
      countTables = PA_CountTables();
      if(PA_GetLastError())
         return -1;
 
      count = 0;
      for(i = 1; i <= countTables;i++)
      {
         count += PA_CountFields(i);
         if(PA_GetLastError())
            return -1;
      }
 
      return count;
   }

See Also

PA_CountTables .

Error Handling

PA_GetLastError

can be called to check if an error occurred