Set Command Info statement - 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

Stores values in memory; other procedures can call the CommandInfo( ) function to retrieve the values. You can issue this statement from the MapBasic window in MapInfo Pro.

Syntax

Set Command Info attribute To new_value

attribute is a code used by the CommandInfo( ) function, such as CMD_INFO_ROWID (2).

new_value is a new value; its data type must match the data type that is associated with the attribute code (for example, if you use CMD_INFO_ROWID (2), specify a positive integer for new_value).

Description

Ordinarily, the CommandInfo( ) function returns values that describe recent system events. The Set Command Info statement stores a value in memory, so that subsequent calls to the CommandInfo( ) function returns the value that you specified, instead of returning information about system events.

Example

Suppose your program has a SelChangedHandler procedure. Within the procedure, the following function call determines the ID number of the row that was selected or de-selected:

CommandInfo(CMD_INFO_ROWID)

When MapInfo Pro calls the SelChangedHandler procedure automatically, MapInfo Pro initializes the data values read by the CommandInfo( ) function. Now suppose you want to call the SelChangedHandler procedure explicitly, using the Call statement―perhaps for debugging purposes. Before you issue the Call statement, issue the following statement to "feed" a value to the CommandInfo( ) function:

Set Command Info CMD_INFO_ROWID To 1 

See Also:

CommandInfo( ) function, Set Handler statement