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?
Hexadecimal uses the decimal numbers and six extra symbols. There are no numerical symbols that represent values greater than nine, so letters taken from the English alphabet are used, specifically A, B, C, D, E and F. Hexadecimal A = decimal 10, and hexadecimal F = decimal 15.
Now, to calculate the hexadecimal number, there are three quick steps (as also stated above): Multiply the first number (or converted number from the letter) by 16. Multiply the second number (or converted number from the letter) by 1. Add those two totals together to get a single value.
Hexadecimal is a numbering system with base 16. It can be used to represent large numbers with fewer digits. In this system there are 16 symbols or possible digit values from 0 to 9, followed by six alphabetic characters -- A, B, C, D, E and F.
For example, the value 97, in hex might be 61. This is a two digit number, containing character "6" followed by "1". Encoded as ASCII that would be two bytes: the value 54 followed by the value 49 (decimal).
Try &HABCD, that's how it works for most BASIC languages.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With