PA_CountTables

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

version 2003


PA_CountTables short

ParameterTypeDescription
This command does not require any parameters
Function resultshortNumber of tables in the database

Description

The command PA_CountTables returns the number of tables in the database.

Tables are numbered from 1 to N in the order of their creation. The current version of 4D lets programmers create up to 255 tables.

Note that if the virtual structure mode is on, this routine returns the count of virtual tables.

Example

Verifying a table number before calling PA_CreateRecord.

   short Wrap_CreateRecord (short tableNum)
   {
      short   err = eER_NoErr;

   // if the table number is less than 0 or higher than
   //  the number of tables, return an error
      if( (tableNum <= 0) || (tableNum > PA_CountTables) )
         return MY_CONSTANT_BAD_TABLE_NUMBER;
   // OK, lets create the record
      PA_CreateRecord(tableNum);
      return PA_GetLastError();
   }

See Also

Count tables, PA_CountFields.

Error Handling

PA_GetLastError always returns 0


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