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

to-binary/skip?

 [1/4] from: petr:krenzelok:trz:cz at: 26-Aug-2001 0:06


Hi, I am just struggling with following: how to convert string of hexadecimal values into binary? I mean: str: "FF00FF00" If I use to-binary, the function converts each char of string separately, while I would like to-binary to treat my string by 2 chars. Would it be usefull to have to-binary/skip refinement? Or is there any other easy way? The only one way which comes to my mind right now is - load rejoin ["#{" FFFF "}"] Thanks, -pekr-

 [2/4] from: larry::ecotope::com at: 25-Aug-2001 16:04


Hi Petr For a long hex-string, the method you suggest is probably the fastest. You can also use DEBASE
>> debase/base str 16
== #{FF00FF00} but I think that DEBASE has some bugs which may cause it to fail on occasion. Cheers -Larry

 [3/4] from: g:santilli:tiscalinet:it at: 26-Aug-2001 17:25


Hello Petr! On 26-Ago-01, you wrote: PK> how to convert string of hexadecimal values into binary? I PK> mean: PK> str: "FF00FF00" debase/base str 16 Regards, Gabriele. -- Gabriele Santilli <[giesse--writeme--com]> - Amigan - REBOL programmer Amiga Group Italia sez. L'Aquila -- http://www.amyresource.it/AGI/

 [4/4] from: petr:krenzelok:trz:cz at: 26-Aug-2001 18:14


----- Original Message ----- From: "Gabriele Santilli" <[g--santilli--tiscalinet--it]> To: <[rebol-list--rebol--com]> Sent: Sunday, August 26, 2001 5:25 PM Subject: [REBOL] Re: to-binary/skip?
> Hello Petr! > > On 26-Ago-01, you wrote: > > PK> how to convert string of hexadecimal values into binary? I > PK> mean: > > PK> str: "FF00FF00" > > debase/base str 16
results in rebol crash .... even last /Command sometimes crashes when debase is used, although above example works. Reported to feedback some time ago, so hopefully they fix it with next release ... Thanks anyway .. -pekr-