Help me with my inability to see a simple solution

william humphrey bill at bluewatermaritime.com
Thu Dec 16 19:36:34 EST 2010


function getMissingNumbers pNumberList
 put empty into vOccurences
 repeat for each item vNumber in pNumberList
   add 1 to vOccurences[vNumber]
 end repeat
 get the keys of vOccurences
 sort lines of it numeric
 put line -1 of it into vLargestNumber
 put empty into vMissing
 repeat with i=1 to vLargestNumber
   if vOccurences[i] is empty then put i & comma after vMissing
 end repeat
 delete char -1 of vMissing
 return vMissing
end getMissingNumbers

this returns a sequential list of all numbers, not just the missing numbers



More information about the use-livecode mailing list