Help me with my inability to see a simple solution

Nonsanity rev at nonsanity.com
Thu Dec 16 22:59:04 EST 2010


My bad... Didn't cover the case of several numbers in a row missing from the
middle of the sequence. This fixes that.


function CheckList src
    sort items of src numeric

    put "," into dups
    put "" into miss

    repeat with a = 1 to item 1 of src - 1
        put a & "," after miss
    end repeat

    repeat with a = 1 to the number of items in src - 1
        if item a of src = item a+1 of src and ("," & item a of src & ",")
is not in dups
        then put item a of src & "," after dups

        put 1 into b
        repeat while item a of src +b < item a+1 of src
            put item a of src + b & "," after miss
            add 1 to b
        end repeat
    end repeat

    return item 1 to -1 of miss & return & item 2 to -1 of dups
end CheckList


 ~ Chris Innanen
 ~ Nonsanity



More information about the use-livecode mailing list