38

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?

BlaM
  • 28,465
  • 32
  • 91
  • 105

4 Answers4

60

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

schnaader
  • 49,103
  • 10
  • 104
  • 136
9

VBScript \ VBA \ VB6 (and lower):

Dim MyValue As Integer
MyValue = &h1234

VB (.NET Framework):

Dim MyValue As Integer = &h1234

Versions are usually backwards compatible syntax-wise, you cannot always use newer syntax in older versions.

ToolmakerSteve
  • 18,547
  • 14
  • 94
  • 196
BobTheBuilder
  • 2,455
  • 2
  • 27
  • 39
4

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

Like: &HABCD

lc.
  • 113,939
  • 20
  • 158
  • 187
0

msgbox hex(255)

Fredou
  • 19,848
  • 10
  • 58
  • 113
  • 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 Jan 09 '09 at 16:11