views:

999

answers:

4

Can someone just help me refresh my mind?

How do you specify hex values in a Visual Basic 6 / VBScript Source?

It's not 0xABCD as it is in C++, that's what I can remember... It was something similar... But what?

A: 

msgbox hex(255)

Fredou
No, the other way around. For example if I want to assign a hex-value to a variable, not to encode an integer to a hex string.
BlaM
your correct, my mistake
Fredou
+10  A: 

Try &HABCD, that's how it works for most BASIC languages.

schnaader
Great, thanks. That's it!
BlaM
No problem. I always knew using PowerBasic for DOS would be useful for something ;)
schnaader
+1  A: 

&H<hex-value> if my memory serves my correctly.

Like: &HABCD

lc
+1  A: 

VBScript/VBA/VB6 (and lower):

Dim MyValue As Integer
MyValue = &h1234

VB (.NET Framework 2.0) and lower:

Dim MyValue As Integer = &h1234

VB (.NET Framework 3.0/3.5):

Dim MyValue = &h1234

All versions can use the same syntax as lower versions but not the other way around...

BobTheBuilder