Purpose
Returns the number of tables currently open. You can call this function from the MapBasic window in MapInfo Pro.
Syntax
NumTables()
Return Value
SmallInt
Description
The NumTables() function returns the number of tables that are currently open.
A street-map table may consist of two "companion" tables. For example, when you open the Washington, DC street map named DCWASHS, MapInfo Pro secretly opens the two companion tables DCWASHS1.TAB and DCWASHS2.TAB. However, MapInfo Pro treats the DCWASHS table as a single table; for example, the Layer Control window shows only the table name DCWASHS. Similarly, the NumTables() function counts a street map as a single table, although it may actually be composed of two companion tables.
Example
If NumTables() < 1 Then
Note "You must open a table before continuing."
End If
See Also:
Open Table statement, TableInfo() function, ColumnInfo() function