filter command

Dave Cragg dcragg at lacscentre.co.uk
Wed Apr 10 17:53:09 EDT 2002


At 6:49 pm +0200 10/4/02, yves COPPE wrote:

>>This is better, I think.
>>
>>function commonLines pList1, pList2
>>    repeat for each line tLine in pList1
>>      put 1 into tArray[tLine]
>>    end repeat
>>    repeat for each line tLine in pList2
>>      if tArray[tLine] = 1 then
>>        put 2 into tArray[tLine]
>>        put tLine & cr after tRetVal
>>      end if
>>    end repeat
>>    delete char -1 of tRetVal
>>    return tRetVal
>>end commonLines
>
>
>
>How, now it's fine, your correction gives the best result.
>Can you adapt your script for filtering lines in fld one that are
>not in fld two and gives as result the lines in fld one that are NOT
>in fld two.

I think you just need to change the comparison in the above script:

   if tArray[tLine] < 1 then

At least, that will give you lines in pList2 that are not in pList1.

Cheers
Dave



More information about the use-livecode mailing list