version 2003
PA_CountTables short
Parameter | Type | Description | ||||
This command does not require any parameters | ||||||
Function result | short | Number 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
Error Handling
PA_GetLastError always returns 0