I would like to apologise to Katie, she was looking at the sequence of posts on the 2011 coursework and became confused with the “Short” data type. At the time I wrote the solution for the 2011 coursework we were using VB6, this uses the Integer data type to store whole numbers. When I created the articles in December, I opened up the original project using VB2008EE to capture the screen grabs. The import wizard unbeknownst to me had changed the data type to short. I should have noticed it but I missed it, sorry.
I’ll let the MS help do the explaining after the break.
Short Data Type (Visual Basic)
- Holds signed 16-bit (2-byte) integers that range 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 can pack your Short variables closely together and save memory consumption.
So to summarise, the short data type is the same size (2 bytes) as the old VB6 integer data type with VB2008EE integer data type being larger (4 Bytes)
The following table has all the sizes.