Purpose
Returns information about the Table List window.
Syntax
TableListInfo( attribute )
attribute is a code indicating the type of information to return; see table below.
Description
The TableListInfo() function returns one piece of information about the Table List window.
The attribute parameter is a value from the table below. Codes in the left column are defined in MAPBASIC.DEF.
attribute code | ID | TableInfo() returns |
---|---|---|
TL_INFO_SEL_COUNT | 1 | Smallint result, indicating the number of selected items. |
Examples
TableListInfo(TL_INFO_SEL_COUNT)
The following example uses this function in conjunction with a custom item on the Table List shortcut menu.
include "mapbasic.def"
include "menu.def"
declare sub main
declare sub ShowTABPaths
'================================================================
sub main
' Add new item to Table List context menu
alter menu ID M_SHORTCUT_TLV_TABLES add
"Show TAB path..." calling ShowTABPaths
end sub
'================================================================
sub ShowTABPaths()
' Get the number of selected items
dim selCount as integer
selCount = TableListInfo(TL_INFO_SEL_COUNT)
' Print the table name and TAB file location fo all selected items
dim index as integer
for index = 1 to selCount
' Get the table id
dim tableId as integer
tableId = TableListSelectionInfo(index, TL_SEL_INFO_ID)
' Use the table in call to get the TAB path
dim tablePath as string
tablePath = TableInfo(tableId, TAB_INFO_TABFILE)
' Print the info
print tableName + " - " + tablePath
next
end sub
See Also:
TableListSelectionInfo() function