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

[REBOL] Re: parse rule for converting hex to decimal

From: sqlab:gmx at: 24-Feb-2010 10:59

On 24.02.2010 10:28, Şemseddin Moldibi wrote:
> Hi, > It is strange but if I put a trace on just before the > parse/all line script gives an error, otherwise it prints just first val > ue. > > trace on > parse/all text [some [opt #"," hex-num]] > > Match: (print hex-to-dec hex-digits) > Input: ,$20,$33,$0102222 > ** Script Error: Trace: "Invalid argument:" (string) > Trace: :arg1 (get-word) > Invalid argument: scheme: console > > r: copy [] parse/all {$FA,$20,$33,$0102} [some > ["$" copy h to "," "," (append r to-integer debase/base h 16)] > ] > probe r >
This string you are parsing here does not include a comma as the last char, as your rule demands. just look at my two former examples.