Filtering one list out of another

Devin Asay devin_asay at byu.edu
Mon Dec 23 18:50:04 EST 2013


On Dec 23, 2013, at 4:24 PM, Dick Kriesel wrote:

> Hi, Devin.  Here's a version that uses arrays for speed.	
> 
> command difference @rList1, @rList2
>    local tArray1, tArray2
>    repeat for each line tLine in rList2
>        put "true" into tArray2[ tLine ]
>    end repeat
>    repeat for each line tLine in rList1
>        if not tArray2[ tLine ] then
>            put "true" into tArray1[ tLine ]
>        end if
>    end repeat
>    put the keys of tArray1 into rList1
> end difference

Clever approach. Thanks, Dick.

Devin

Devin Asay
Learn to code with LiveCode University
http://university.livecode.com





More information about the Use-livecode mailing list