
How to display int, short int range values
Quote:
> I need something very simple... i need to be able to display/print out
what the
> ranges are for int, short int, long int, float , and double? How can i do
this
> in a simple vb program?
For Integer and Long you can do:
Dim ISize As Integer
Dim LSize As Long
ISize = LenB(ISize) ' get # bytes in an Integer
LSize = LenB(LSize) ' get # bytes in a Long
MsgBox "Integer: " & CStr(-(2 ^ (8 * ISize))) & " to " & CStr(2 ^ (8 *
ISize) - 1) & vbNewLine & _
"Long: " & CStr(-(2 ^ (8 * LSize))) & " to " & CStr(2 ^ (8 * LSize) - 1)
I'm not sure offhand how to determine the values for floating point values.