Integer Data Type for Visual Basic 6.0 Users
In Visual Basic 2008, the integer data types differ from those in Visual Basic 6.0. These changes were made for interoperability with other programming languages and with the common language runtime.
The following table shows correspondences between integer types in Visual Basic 6.0 and Visual Basic 2008.
Integer size |
Visual Basic 6.0 type and identifier type character |
Visual Basic 2008 type and identifier type character |
Common language runtime (CLR) type |
---|---|---|---|
8 bits, signed |
(none) |
SByte (none) |
|
8 bits, unsigned |
Byte (none) |
Byte (none) |
|
16 bits, signed |
Integer (%) |
Short (none) |
|
16 bits, unsigned |
(none) |
UShort (none) |
|
32 bits, signed |
Long (&) |
Integer (%) |
|
32 bits, unsigned |
(none) |
UInteger (none) |
|
64 bits, signed |
(none) |
Long (&) |
|
64 bits, unsigned |
(none) |
ULong (none) |
On 32-bit systems, 32-bit integer operations are faster than either 16-bit or 64-bit integer operations. This means that in Visual Basic 2008, Integer and UInteger are the most efficient and fundamental numeric types. You can improve performance in your applications by changing your Long declarations to Integer when you migrate to Visual Basic 2008.
Note
If you are interfacing with components created on platforms other than Visual Basic 2008, you must make sure that your data types correspond to those of the other components. For example, if you use a Declare statement to refer to an external procedure created in Visual Basic 6.0, and the procedure defines an Integer argument (two bytes in Visual Basic 6.0), you must identify that argument as Short in the Declare statement, because that is the two-byte integer type in Visual Basic 2008.
See Also
Concepts
Programming Element Support Changes Summary