By the way, Thanks Ingo, you got it right.
I can stop hitting my head now.
----- Original Message -----
From: Ingo Hohmann <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, February 17, 2004 3:34 AM
Subject: [REBOL] Re: auto id's for vid objects


>
> Hi iNetW3,
>
> maybe the following does what you want, but beware: it's not elegant, I
> just parse the whole string for all buttons first, and then restart to
> find all texts.
>
>   x: {button "one" button "two"  text "browser"}
>   ;x: {button "one" text "browser" button "two"}
>
>   button_count: 0
>   txt_count: 0
>
>   btn: to-string reduce [ to-set-word 'id ": " to-set-word 'btn]
>   txt: to-string reduce [ to-set-word 'id ": " to-set-word 'txt]
>
>   parse x [
>     home-mark:
>     any [
>        to "button" mark:(
>           remove/part mark 6  insert mark reduce [btn button_count:
> button_count + 1
>           ":"{ }"button"])
>        :mark 12 skip
>     ]
>     :home-mark
>
>     any [
>        to "text" mark:(
>           remove/part mark 4  insert mark reduce [txt txt_count: txt_count
+ 1
>           ":"{ }"text"])
>        :mark 12 skip
>
>      ]
>   ]
>
>
> I hope that helps,
>
> Ingo
>



-- 
To unsubscribe from this list, just send an email to
[EMAIL PROTECTED] with unsubscribe as the subject.

Reply via email to