Yes!! That is exactly the result I was looking for. Thank you for your
efforts Ladislav.

Pity it is a sequential search. Now I wonder if RT could incorporate this
functionality so that it works with hashes...?
:)

Brett.


----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, July 16, 2000 5:46 PM
Subject: [REBOL] Find cant find reference to block. Re:(5)


> Hi,
>
> > From: <[EMAIL PROTECTED]>
> > > >> probe find/only reverse_lookup :e ; The answer:
> > > [[] "a" ["added to the series"] "b" [] "c"]
> > > == [[] "a" ["added to the series"] "b" [] "c"]
> > >
> >
> > Thanks, but no - I tried that too. I wanted this to return [[]
> "c"] since
> > that was what "e" was referring to.
> >
> >
>
> So, you needed a function sfind?
>
> sfind: func [
>     {finds the same value as a given one in a given series}
>     series [series!]
>     value [any-type!]
> ] [
>     while [not tail? :series] [
>         if same? first :series get/any 'value [
>             return :series
>         ]
>         series: next :series
>     ]
>     none
> ]
>
> >>  probe sfind reverse_lookup :e ; The answer:
> [[] "c"]
> == [[] "c"]
>
> Regards
>     Ladislav
>

Reply via email to