filter?

J. Landman Gay jacque at hyperactivesw.com
Wed Jun 22 21:30:01 CDT 2011


On 6/22/11 9:19 PM, Michael Kann wrote:
> If you want to use a SORT you can try something like the following:
>
> on mouseUp
> put "1,2,3,4" into v
> put "1,2,3,4,5"&  cr before v
> replace comma with cr in v
> sort v
> repeat for each line x in v
>    if x&  cr&  x is not in v then
>      put x&  cr after h
>    end if
> end repeat
> put h into fld 3 -- "5"
> end mouseUp

That may be faster than the way I was going to do it. I would have done:

function getUnique pList1,pList2
   put pList1 & cr & pList2 into tTemp
   repeat for each line l in tTemp
     add 1 to array[l]
   end repeat
   repeat for each key k in array
     if array[k] = 1 then put k & cr after tList
   end repeat
   return tList
end getUnique

But arrays have some overhead. Timing may depend on how long the lists are.

-- 
Jacqueline Landman Gay         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com



More information about the use-livecode mailing list