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
_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to