Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Handling hexes

From: chalz::earthlink::net at: 2-Nov-2002 12:10

Greets folks. A bit of a question. I'm working with ascii<->hex here, and am only finding to-hex and dehex in REBOL, and to-hex only works on int, and returns a series! which looks like #00000043. I want to convert that to a normal 256 style of 2 values each (43). Sure, I can parse or replace the 0's, but when I get to say #00000050 then I have a problem. Unless I do replace/all value "00" "", which fubars at #00000100 (which is 256 - I know, in base-256 you go 0 to 255, which is FF). Does anyone have a far better method? It's rather annoying trying to convert val: to-hex 24 and convert val back to 24 (for checking). Thanks all.