this just uses a simple parse and some post-processing

foreach item (parse/all text "$,") [
        if (0 < length? item) [
                append result to-integer debase/base item 16
        ]
]

On 22 Feb 2010, at 14:01, [email protected] wrote:

To:                     [email protected]
Date sent:              Mon, 22 Feb 2010 14:01:45 +0200
Subject:                [REBOL] parse rule for converting hex to decimal
Copies to:              [email protected]
From:                   [email protected]
Organization:           Bircom
Send reply to:          [email protected]



is there anyone already write a parse rule to convert hexadecimal to  
decimal? here is my situation,

text: {$FA,$20,$33,$0102}
result: copy []
rule: [(append value to result)]
parse text rule

result
>> [250 32 51 258]

-- 
To unsubscribe from the list, just send an email to 
lists at rebol.com with unsubscribe as the subject.


__________________________________________

   Various gadgets widgets, links and chat
     http://www.marmaladefoo.com
__________________________________________
-- 
To unsubscribe from the list, just send an email to 
lists at rebol.com with unsubscribe as the subject.

Reply via email to