Purpose
Returns information about the operating system or software version. You can call this function from the MapBasic window in MapInfo Pro.
Syntax
SystemInfo( attribute )
attribute is an integer code indicating which system attribute to query.
Return Value
SmallInt, logical, or string
Description
The SystemInfo() function returns information about MapInfo Pro's system status. The attribute can be any of the codes listed in the table below. The codes are defined in MAPBASIC.DEF
attribute code | ID | SystemInfo() Return Value |
---|---|---|
SYS_INFO_PLATFORM | 1 | Integer: the hardware platform on which the application is running. The return value will be PLATFORM_WIN. |
SYS_INFO_APPVERSION | 2 | Integer: the version number with which the application was compiled, multiplied by 100. |
SYS_INFO_MIVERSION | 3 | Integer: the version of MapInfo Pro that is currently running, multiplied by 100. |
SYS_INFO_RUNTIME | 4 | Logical: TRUE if invoked within a run-time version of MapInfo Pro, FALSE otherwise. |
SYS_INFO_CHARSET | 5 | String: the name of the native character set. |
SYS_INFO_COPYPROTECTED | 6 | Logical: TRUE means the user is running a copy-protected version of MapInfo Pro. |
SYS_INFO_APPLICATIONWND | 7 | IntPtr*: the Windows HWND specified by the Set Application Window statement (or zero if no such HWND has been set). |
SYS_INFO_DDESTATUS | 8 | Integer: the number of elements in the DDE execute queue. If the queue is empty, SystemInfo() returns zero (if an incoming execute would be enqueued) or -1 (if an execute would be executed immediately). |
SYS_INFO_MAPINFOWND | 9 | IntPtr*: a Windows HWND of the MapInfo Pro frame window, or zero on non-Windows platforms. |
SYS_INFO_NUMBER_FORMAT | 10 | String: "9,999.9" or "Local" depending on the number formatting in effect; for details, see Set Format statement. |
SYS_INFO_DATE_FORMAT | 11 | String: "US" or "Local" depending on the date formatting in effect; for details, see Set Format statement. |
SYS_INFO_DIG_INSTALLED | 12 | Logical: TRUE if a digitizer is installed, along with a compatible driver. |
SYS_INFO_DIG_MODE | 13 | Logical: TRUE if Digitizer Mode is on. |
SYS_INFO_MIPLATFORM | 14 | Integer: the type of MapInfo Pro software that is running. The return values are: MIPLATFORM_WIN32 (2) for 32 bit version of MapInfo Pro, or MIPLATFORM_WIN64 (7) for 64 bit version of MapInfo Pro. |
SYS_INFO_MDICLIENTWND | 15 | IntPtr*: a Windows HWND of the MapInfo Pro MDICLIENT window, or zero on non-Windows platforms. |
SYS_INFO_PRODUCTLEVEL | 16 | Integer: the product level of the of the version of MapInfo Pro that is running either 100 for MapInfo Desktop (a retired product) or 200 for MapInfo Pro. |
SYS_INFO_APPIDISPATCH | 17 | IntPtr*: the IDispatch OLE Automation pointer for the MapInfo application. Here is an example of how to use this:
|
SYS_INFO_MIBUILD_NUMBER | 18 | Integer: this function has an attribute to return the current build number so you can distinguish between MapInfo Pro point versions in MapBasic.
For example, SystemInfo(SYS_INFO_MIVERSION) returns 850 for MapInfo Pro 8.5 and 8.5.2. You can further distinguish between 8.5 and 8.5.2 with SystemInfo(SYS_INFO_MIBUILD_NUMBER), which returns 32 for 8.5, and 60 for 8.5.2. |
SYS_INFO_MIFULLVERSION | 19 | Integer: the full version number, including minor and maintenance versions, of the currently running MapInfo Pro. This value represents the version string without decimal points.
SystemInfo(SYS_INFO_MIFULLVERSION) returns 1103 for version 11.0.3. This is more detail than using SystemInfo(SYS_INFO_MIVERSION), which returns 1100 for MapInfo Pro 11.0 and 11.0.3. |
SYS_INFO_IMAPINFOAPPLICATION | 20 | Returns an instance of the MapInfo Pro application represented as a .NET Specific Variable. This variable type refers to an instance of IMAPINFOPRO (MapInfo.Types.IMapInfoPro), which is the base interface providing access to MapInfo Pro components in your Add-ins. This must be called from a running .MBX and only in MapInfo Pro 64-bit. It will not work in the MapBasic window or from the MapInfo Pro COM API. |
SYS_INFO_MAPINFO_INTERFACE | 21 | Integer: returns the kind of user interface in use: classic menu and toolbar MIINTERFACE_CLASSICMENU (0), or ribbon interface MIINTERFACE_RIBBON (1). |
SYS_INFO_UNICODE | 22 | Logical: TRUE when MapInfo Pro (64-bit version) is running as Unicode, and FALSE when running a multi-byte character set. |
SYS_INFO_CULTURE | 23 | String: returns a two-letter culture code, which the running instance of MapInfo Pro is using ("en" = English, "fr" = France, "de" = German, "ja" = Japanese). The value comes from the installed version of Pro (mires.dll). Valid culture codes are: cs (Czech), da (Danish), de (German), en (English), es (Spanish), fi (Finnish), fr (French), he (Hebrew), it (Italian), ja (Japanese), nl (Dutch), pl (Polish), pt (Portuguese), ru (Russian), sv (Swedish), tr (Turkish), and zh (Chinese). For details about these codes, see the Microsoft Language Codes web site athttps://msdn.microsoft.com/en-us/library/ms533052(v=vs.85).aspx. |
SYS_INFO_LOCALE | 24 | String: returns a locale string, such as "en-US" or "ja-JP", from the running instance of MapInfo Pro. The value comes from the Operating System. For a list of locale strings, see the Microsoft Table of Language Culture Names, Codes, and ISO Values Method web site at https://msdn.microsoft.com/en-us/library/ee825488(v=cs.20).aspx. |
SYS_INFO_MIRIBBONSTATE_VERSION | 25 | Integer: returns the current MapInfo Pro ribbon state version. |
SYS_INFO_LICENSE_MODE | 26 |
SmallInt: Current license mode that MapInfo Pro is running. Expected values: 0: Traditional FlexLM licensed mode 1: Subscription Mode. |
SYS_INFO_SUBSCRIPTION_PLAN |
27 |
String: Current subscription plan name that MapInfo Pro is running. Expected values: Subscription license mode returns Plan Name (for example, Viewer). Traditional FlexLM licensed mode returns empty string. |
SYS_INFO_SQL_VERSION | 28 | Integer : Returns the current SQL version(1900 or 1700) for the session. |
* IntPtr is a platform specific type that is used to represent a pointer or a handle. This helps to write applications that will work with both the 32-bit and 64-bit versions of MapInfo Pro. The 64-bit version of MapInfo Pro treats this like a LargeInt, and the 32-bit version of MapInfo Pro treats this like an Integer.
Error Conditions
ERR_FCN_ARG_RANGE (644) error is generated if an argument is outside of the valid range.
Example
The following example uses the SystemInfo() function to determine what type of MapInfo software is running. The program only calls a DDE-related procedure if the program is running some version of MapInfo Pro.
Declare Sub DDE_Setup
If SystemInfo(SYS_INFO_PLATFORM) = PLATFORM_WIN Then
Call DDE_Setup
End If
See also: