How to display int, short int range values 
Author Message
 How to display int, short int range values

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?


Tue, 15 Jul 2003 05:08:48 GMT  
 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.



Tue, 15 Jul 2003 05:26:46 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Converting BitArray to Int and Int to BitArray

2. Int to Str or Str to Int ??

3. Converting ULONG (4 byte binary) int VB Long / SQL INT for DTS Import

4. Convert Int to Str & Str to Int

5. int main( int argc, char *argv[]) in VB??

6. unsigned short int and unsigned char

7. unsigned short int

8. Does anyone know how to use new Bitmap(int,int,int,PixelFormat, IntPtr) ?

9. Displaying int as string

10. Get the int[ ] return value in Win32_BIOS

11. Help: Comparison of Double with Int value

12. Rounding Int Values

 

 
Powered by phpBB® Forum Software