version 11 (Modified)
Get last table number Number
Parameter | Type | Description | ||||
This command does not require any parameters | ||||||
Function result | Number | Highest table number in the database |
Description
Get last table number returns the number of tables in the database. Tables are numbered in the order in which they are created. If no table has been deleted from the database, this command then returns the number of tables present in the database. In the case of repeated loops on the table numbers of the database, you must use the Is table number valid command in order to check that the table has not been deleted.
Example
The following example builds an array, named asTables, with the names of tables defined in the database. This array can be used as a drop-down list (or tab control, scrollable area, and so on) to display the list of the tables, within a form:
ARRAY STRING (31;asTables;Get last table number) If (Get last table number>0) `If the database does contain tables For ($vlTables; Size of array(asTables);1;-1) If(Is table number valid($vlTables)) asTables {$vlTables}:=Table name ($vlTables) Else DELETE FROM ARRAY(asTables; $vlTables) End if End for End if
See Also
Get last field number, Is table number valid, Table name.