[REBOL] Re: parse rule for converting hex to decimal
From: luke:marmaladefoo at: 22-Feb-2010 17:39
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, semseddinm-bircom.com wrote:
To: rebolist-rebol.com
Date sent: Mon, 22 Feb 2010 14:01:45 +0200
Subject: [REBOL] parse rule for converting hex to decimal
Copies to: semseddin-gmail.com
From: semseddinm-bircom.com
Organization: Bircom
Send reply to: rebolist-rebol.com
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