PA_CountFields

4D - Documentation   Français   English   German   4D Plugin API, Command Theme List   4D Plugin API, Command Alphabetical List   Back   Previous   Next

version 2003


PA_CountFields (tableNum) short

ParameterTypeDescription
tableNumshortTable number
Function resultshortNumber 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


4D - Documentation   Français   English   German   4D Plugin API, Command Theme List   4D Plugin API, Command Alphabetical List   Back   Previous   Next