boeman
asked on
Constants with & prefix and variables with % trailer
Hi,
As I'm broadening my VB knowledge, I came across things like this a couple of times:
Private Const GENERIC_READ = &H80000000
this is usually used with API calls it seems
and things like this:
For i%=0 to 100
Array(i%) = "Lipsum"
Next i%
Now I suppose the first has something to do with hexadecimals. Just a wild guess, but I'd like to know more about that.
The second one is a puzzler. I used it a couple of times myself, to dynamically create control arrays, but what it means... You got me.
As I'm broadening my VB knowledge, I came across things like this a couple of times:
Private Const GENERIC_READ = &H80000000
this is usually used with API calls it seems
and things like this:
For i%=0 to 100
Array(i%) = "Lipsum"
Next i%
Now I suppose the first has something to do with hexadecimals. Just a wild guess, but I'd like to know more about that.
The second one is a puzzler. I used it a couple of times myself, to dynamically create control arrays, but what it means... You got me.
You got it. &H is for hexadecimal. The % I believe is for long integer's.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
% is for Integer
& is for Long
$ is for string
# is for Double
! is for single
& is for Long
$ is for string
# is for Double
! is for single
ASKER
Thanks TimCottee, that part of the question is clear for me now.
jmwheeler: for the &H, &D etc, it stands for hexadecimal and decimal etc.. But I need some kind of explanation or a nice example.
Tim is going to be rewarded with half of the points for trailing sings.
jmwheeler: for the &H, &D etc, it stands for hexadecimal and decimal etc.. But I need some kind of explanation or a nice example.
Tim is going to be rewarded with half of the points for trailing sings.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
OK, thanks for rectifying this issue.