How To Use an Ampersand (&) to Suppress Sign Extension (138520)
The information in this article applies to:
- Microsoft Visual Basic Control Creation Edition for Windows 5.0
- Microsoft Visual Basic Learning Edition for Windows 5.0
- Microsoft Visual Basic Professional Edition for Windows 5.0
- Microsoft Visual Basic Enterprise Edition for Windows 5.0
- Microsoft Visual Basic Standard Edition, 32-bit, for Windows 4.0
- Microsoft Visual Basic Professional Edition, 16-bit, for Windows 4.0
- Microsoft Visual Basic Professional Edition, 32-bit, for Windows 4.0
- Microsoft Visual Basic Enterprise Edition, 16-bit, for Windows 4.0
- Microsoft Visual Basic Enterprise Edition, 32-bit, for Windows 4.0
This article was previously published under Q138520 SUMMARY
Adding an ampersand (&) character to the end of a Hexadecimal number will
ensure that it is not sign extended. This can be useful when an unsigned
constant must be passed to a routine and the magnitude of the constant is
greater than or equal to 32,768 (&H8000 in Hexadecimal). If the ampersand
is not placed on the end of the constants, Visual Basic assumes that the
numbers are sign extended.
Modification Type: | Minor | Last Reviewed: | 7/13/2004 |
---|
Keywords: | kbhowto kbprogramming KB138520 |
---|
|