Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Integer Data Type Changes in Visual Basic

Integer Data Type Changes in Visual Basic

Visual Basic .NET updates the integer data types 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 .NET.

Integer Size Visual Basic 6.0 type and identifier type character Visual Basic .NET type and identifier type character Common language runtime type
8 bits, signed (none) (none) System.SByte
16 bits, signed Integer (%) Short (none) System.Int16
32 bits, signed Long (&) Integer (%) System.Int32
64 bits, signed (none) Long (&) System.Int64

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 .NET, Integer is the most efficient and fundamental numeric type. You can improve performance in your applications by changing your Long declarations to Integer when you migrate to Visual Basic .NET.

Note   If you are interfacing with components created on platforms other than Visual Basic .NET, you must take care 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 .NET.

See Also

Data Type Summary | Integer Data Type | Short Data Type | Long Data Type | Type Characters | Programming Element Support Changes Summary

Show:
© 2015 Microsoft