How to get hex zeros or hex FF into a string ?

  • Thread starter Thread starter Tony Girgenti
  • Start date Start date
T

Tony Girgenti

How do you get binary zeros or hex FF into a string ?

I tried Hex(0) and Hex(FF), but they just yield ascii "0" and ascii "FF".

Also, when you WATCH a variable, how do you show it contents in hex ?

Thanks,
Tony
 
Tony Girgenti said:
How do you get binary zeros or hex FF into a string ?

I tried Hex(0) and Hex(FF), but they just yield ascii "0" and ascii
"FF".

Chr(0) and Chr(255) ought to do it.
 
If he wanted string values "0" and "255", he would just use:

"0"
"255"

not:

hex$(0)
hex$(255) !

I think he wants a 1-byte item containing the value &h0 or &hFF. When he
says "string", it sounds like he wants that 1-byte value to be followed by a
1-byte &h0 terminator.

But, as all he can say is "it doesn't work", we will probably never know ...

TC
 
According to the HELP file, you have to use decimal
numbers in the Hex function. So Hex(0) results in a string
0 ("0") and Hex(255) results in a string FF ("FF").

You can also use &H0 or &HFF; these result in numbers
which can then be converted to strings like you wanted.

HTH

Steve
 
Back
Top