filter?

Roger Eller roger.e.eller at sealedair.com
Wed Jun 22 20:51:09 EDT 2011


On Wed, Jun 22, 2011 at 8:38 PM, Nicolas Cueto wrote:

> Hi again.
>
> Given 2 lists of cr-delimited values (tList1, tList2), what's the fastest
> way of getting the unique value(s)?
>
> Ex, "1,2,3,4" & "1,2,3,4,5" = "5"
> (but cr instead of comma)
>
> Thanks.
>
> --
> Nicolas Cueto (iPhone)
>

Assuming that each value is on its own line (cr delimited), I would...

repeat with i = 1 to the number of lines of tListA
   if line i of tListA is not among the lines of tListB then put line i of
tListA & cr after tUniqueOfA
end repeat
put tUniqueOfA

Then reverse it...

repeat with i = 1 to the number of lines of tListB
   if line i of tListB is not among the lines of tListA then put line i of
tListB & cr after tUniqueOfB
end repeat
put tUniqueOfB

˜Roger



More information about the Use-livecode mailing list