Re: find/match not working

new topic     » goto parent     » topic index » view thread      » older message » newer message

On 17 Aug 2004, at 8:17, don cole wrote:

> 
> 
> posted by: don cole <doncole at pacbell.net>
> 
> I re-thought this.
> }}}
<eucode>
>  integer a
>  sequence newlist,found
>   newlist={}
>   found={}
>  for loop=1 to length(urllist) do
>    a=find(urllist[loop],found))
>    if a=0 then
>       found=append(found,urllist[loop])  
>     -- newlist=append(newlist,urllist[loop])--you don't really need newlist
>                                         --unless you are going to alter
>    end if                                   --urllist[loop] before you add 
>  end for                                    --it to your sequence.
>  urllist=found
> --now your list is free of duplicates--

The list started out with nothing in it, so i am somewhat sure it had no 
duplicates. The following code you wrote is exactly what i had before i went 
to using match() instead.

> for loop=1 to length(urllist) do
>    if find(junk,urllist[loop]) then
>      exit
>    end if
> end for
>   urllist=urlist & {junk}
> </eucode>
{{{

> 
> don cole
> SF

Kat

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu