NumTables() function - MapBasic - 2023

MapInfo MapBasic Reference

Product type
Software
Portfolio
Locate
Product family
MapInfo
Product
MapInfo > MapBasic
Version
2023
Language
English
Product name
MapBasic
Title
MapInfo MapBasic Reference
First publish date
1985
Last updated
2023-09-12
Published on
2023-09-12T16:32:32.686312

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