Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.

Short Data Type (Visual Basic) 

Holds signed 16-bit (2-byte) integers ranging in value from -32,768 through 32,767.

Use the Short data type to contain integer values that do not require the full data width of Integer. In some cases the common language runtime might be able to pack your Short variables closely together and save memory consumption.

The default value of Short is 0.

Programming Tips

  • Widening. The Short data type widens to Integer, Long, Decimal, Single, or Double. This means you can convert Short to any of these types without encountering a System.OverflowException error.

  • Type Characters. Appending the literal type character S to a literal forces it to the Short data type. Short has no identifier type character.

  • Framework Type. The corresponding type in the .NET Framework is the System.Int16 structure.

Community Additions

ADD
Show:
© 2015 Microsoft