In the following section of code:
dim i%
What does the "%" do for me?
Printable View
In the following section of code:
dim i%
What does the "%" do for me?
Should be equivalent to "Dim i As Integer".
Basically just a shortcut for declaring the variable type.
Dim i
- i will be a variant
Dim i%
- i will be an Integer (2 bytes)
Dim i&
- i will be a Long Integer (4 bytes)
Dim i!
- i will be Single-precision floating point.
There are a few more. Any good VB book will list these out.
[Edited by jbart on 08-21-2000 at 11:22 AM]
Thanks so much. My trusty book isn't with me today and MSDN isn't much help on a search for "%".
I got that off of an Old VB3 help file, I couldnt seem to find them in MSDN...Code:Integer % 2 bytes -32,768 to 32,767.
Long
(long integer) & 4 bytes -2,147,483,648 to 2,147,483,647.
Single
(single-precision floating-point) ! 4 bytes -3.402823E38 to -1.401298E-45 for negative values; 1.401298E-45 to 3.402823E38 for positive values.
Double
(double-precision floating-point) # 8 bytes -1.79769313486232E308 to
-4.94065645841247E-324 for negative values; 4.94065645841247E-324 to 1.79769313486232E308 for positive values.
Currency
(scaled integer) @ 8 bytes -922,337,203,685,477.5808 to 922,337,203,685,477.5807.
String $ 1 byte per character 0 to approximately 65,500 bytes. (Some storage overhead is required.)