Help me with my inability to see a simple solution
william humphrey
bill at bluewatermaritime.com
Thu Dec 16 19:46:51 EST 2010
Thanks Terry. This solved my problem!
On Thu, Dec 16, 2010 at 8:03 PM, Terry Judd <tsj at unimelb.edu.au> wrote:
> pMin is your minimum value
> pMax is your maximum value
> pList is your list of numbers to test
> The output is a list of missing numbers (line 1) and repeat numbers (line
> 2)
>
> function stuff pMin, pMax, pList
> put empty into tMissingList
> put empty into tDuplicateList
> repeat with i = pMin to pMax
> put true into tMissing
> put empty into tDuplicate
> repeat for each item tValue in pList
> if tValue = i then
> put false into tMissing
> put i & comma after tDuplicate
> end if
> end repeat
> if tMissing then
> put i & comma after tMissingList
> end if
> if the number of items in tDuplicate > 1 then
> put i & comma after tDuplicateList
> end if
> end repeat
> return (char 1 to -2 of tMIssingList) &cr& \
> (char 1 to -2 of tDuplicateList)
> end stuff
>
--
http://www.bluewatermaritime.com
More information about the use-livecode
mailing list