Link to home
Start Free TrialLog in
Avatar of boeman
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.
Avatar of jmwheeler
jmwheeler

You got it.  &H is for hexadecimal.  The % I believe is for long integer's.
SOLUTION
Avatar of TimCottee
TimCottee
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
% is for Integer
& is for Long
$ is for string
# is for Double
! is for single
Avatar of boeman

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.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of boeman

ASKER

OK, thanks for rectifying this issue.