Purpose
Returns the number of columns in a specified table. You can call this function from the MapBasic window in MapInfo Pro.
Syntax
NumCols( table )
table is the name of an open table.
Return Value
SmallInt
Description
The NumCols() function returns the number of columns contained in the specified open table.
The number of columns returned by NumCols() does not include the special column known as Object (or Obj for short), which refers to the graphical objects attached to mappable tables. Similarly, the number of columns returned does not include the special column known as RowID.
Note: If a table has temporary columns (for example, because of an Add Column statement), the number returned by NumCols() includes the temporary column(s).
Error Conditions
ERR_TABLE_NOT_FOUND (405) error generated if the specified table is not available.
Example
Dim i_counter As Integer
Open Table "world"
i_counter = NumCols(world)
See Also:
ColumnInfo() function, NumTables() function, TableInfo() function