Variables - 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
Declare local or global variables: Dim,Global
Resize array variables: ReDim, UBound(), UnDim
Declare custom data structure: Type

Large Integer Variables

MapBasic uses the integer types SmallInt, Integer, and LargeInt. LargeInt is a type for storing 64-bit (8 byte) integers; use the Dim statement to create a LargeInt variable.

SmallInt Whole numbers from -32768 to 32767 (inclusive); stored in 2 bytes.
Integer Whole numbers from -2,147,483,648 to +2,147,483,647 (inclusive); stored in 4 bytes.
LargeInt Whole numbers from –9,223,372,036,854,775,808 to +9,223,372,036,854,775,807 (inclusive); stored in 8 bytes.

LargeInt variables are supported in MapBasic, but they are not a fully supported type in a table, because some operations may not work correctly for large values (such as thematic maps). Some mathematic calculations or functions generate a LargeInt value. If the value is outside the range for an Integer variable and your application tries to store the result in an Integer, you will get an overflow error.

The following functions return a LargeInt value:

The following statements accept a LargeInt value for the file position:

The following function return a IntPtr value when the specified attributes are requested.

Note: 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.