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

[REBOL] Re: Working with Binary conversions

From: greggirwin:mindspring at: 1-Dec-2001 12:58

Hi Paul, << I thought I would pass this on if you ever trying to work with binary data and need it in its current state without conversion and need to get at it as a string. Try this: >> A semi-related question. Why can't you poke binary values? Change works, but poke only seems to let you use char! values (haven't tried exhaustive data type checking yet).
>> data: to-binary "Convert me ton binary"
== #{436F6E76657274206D6520746F6E2062696E617279}
>> change at data 2 #{FF}
== #{6E76657274206D6520746F6E2062696E617279}
>> data
== #{43FF6E76657274206D6520746F6E2062696E617279}
>> poke data 3 #{FF}
** Script Error: Invalid argument: #{FF} ** Near: poke data 3 #{FF}
>> poke data 3 #""
== #{43FFFF76657274206D6520746F6E2062696E617279} Or am I making some basic mistake here? --Gregg