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

[REBOL] Re: Poke and Pick and binary! - bug

From: larry:ecotope at: 3-May-2001 12:48

Hi Joel Good explanation. There is one more feature which can be handy. To directly convert an integer in the range 0 to 255 to a 1-byte binary, just put it in a block:
>> to-binary [255]
== #{FF}
>> to-integer to-binary [255]
== 255 As you noted the last line will return a full 4-byte REBOL integer (same as long in C). REBOL does not natively support 2-byte integers, 1-byte integers can be handled as char. -Larry