I would not call these beauties, but they are smaller, so less ugliness to look at...

to-short: func [v][to-binary join to-char v / 256 to-char v // 256]

to-byte: func [v][to-binary to-char v // 256]

--Ryan


Hallvard Ystad wrote:

> When I do java programming, I have the types BYTE and SHORT. I haven't found this in 
>rebol, so I convert integers this way:
>
> short: load rejoin ["#{" pick to-hex some-integer 5
>                          pick to-hex some-integer 6
>                          pick to-hex some-integer 7
>                          pick to-hex some-integer 8
>                    "}"]
>
> byte: load rejoin ["#{"  pick to-hex some-integer 7
>                          pick to-hex some-integer 8
>                   "}"]
>
> 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?
>
> ~H
> Praetera censeo Carthaginem esse delendam
>
> --
> To unsubscribe from this list, please send an email to
> [EMAIL PROTECTED] with "unsubscribe" in the
> subject, without the quotes.

--


     Ryan Cole
 Programmer Analyst
 www.iesco-dms.com
    707-468-5400


-- 
To unsubscribe from this list, please send an email to
[EMAIL PROTECTED] with "unsubscribe" in the 
subject, without the quotes.

Reply via email to