Re: Hex to String??? by Alex
Alex
Mon Dec 01 15:33:16 CST 2003
JesseH wrote:
> I've been browsing and I can't seem to find a good way in
> vbs to convert a hex to a string. I see a hex() function
> that takes a string but I don't see a toString() that
> takes a hex vaule.
>
> Can anybody point me to a usefull resource? I'd be more
> than happy to work with a conversion table...
>
> thanks, and you guys are great!
> -Jess
Jess, the hex() function actually takes a number and converts it to a string
hexadecimal representation; in memory, a hex value is just another number.
So the number 47 when transformed with Hex() yields the string 2F.
What are you after, actually? It sounds like you want to take an actual hex
string representation of a number and do something else to it, but I'm not
sure what. If you want to take a Hex string and turn it into an actual
number again, you would prepend "&H" to it and convert it to a long...
newNum = CLng( "&H" & myHexString )