UShort Data Type (Visual Basic)
Updated: July 20, 2015
For the latest documentation on Visual Studio 2017 RC, see Visual Studio 2017 RC Documentation.
Holds unsigned 16-bit (2-byte) integers ranging in value from 0 through 65,535.
UShort data type to contain binary data too large for
The default value of
UShort is 0.
Negative Numbers. Because
UShortis an unsigned type, it cannot represent a negative number. If you use the unary minus (
-) operator on an expression that evaluates to type
UShort, Visual Basic converts the expression to
CLS Compliance. The
UShortdata type is not part of the Language Independence and Language-Independent Components (CLS), so CLS-compliant code cannot consume a component that uses it.
UShortdata type widens to
Double. This means you can convert
UShortto any of these types without encountering a System.OverflowException error.
Type Characters. Appending the literal type characters
USto a literal forces it to the
UShorthas no identifier type character.
Framework Type. The corresponding type in the .NET Framework is the System.UInt16 structure.