Hallvard Ystad wrote:

> I don't find this a very sexy way to do it. Has anyone got any suggestions to do it 
>in a more intuitive way?

>> byte: make struct! [value [char]] [#"^(00)"]
>> byte/value: #"A"
== #"A"
>> third byte
== #{41}
>> short: make struct! [value [short]] [0]
>> short/value: 15342
== 15342
>> third short
== #{EE3B}

WARNING: machine dependend. As you can see, endianess counts.

This can be used to convert the other way around:

>> change third short #{FF0A}
== #{}
>> short/value
== 2815

This works on /View even without /Pro key.

Regards,
   Gabriele.
-- 
Gabriele Santilli <[EMAIL PROTECTED]> - Amigan - REBOL programmer
Amiga Group Italia sez. L'Aquila -- http://www.amyresource.it/AGI/
-- 
To unsubscribe from this list, please send an email to
[EMAIL PROTECTED] with "unsubscribe" in the 
subject, without the quotes.

Reply via email to