Algorithm time...
Glen Bojsza
gbojsza at gmail.com
Sun Dec 9 19:31:05 EST 2012
That's it!!
500,000 points in 419 milliseconds.
This scales perfectly for what I need.
thanks Dick.
On Sun, Dec 9, 2012 at 7:07 PM, Dick Kriesel <dick.kriesel at mail.com> wrote:
> Hi, Glen. I've reread your replies. Here's a new version that returns
> the original values, as needed.
>
> Please test and report again.
>
> -- Dick
>
>
>
> <postScript>
> function digest @pLines
> local tGroupSize, tLineNumber, tArray, tKeys, tMin, tMax, tResult
> put number of lines in pLines div 1000 into tGroupSize
> set the itemDelimiter to tab
> repeat for each line tLine in pLines
> add 1 to tLineNumber
> if tArray[ item 2 of tLine ] is empty then
> put item 1 of tLine into tArray[ item 2 of tLine ]
> end if
> if tLineNumber is tGroupSize then
> put the keys of tArray into tKeys
> replace cr with comma in tKeys
> put min( tKeys ) into tMin
> put max( tKeys ) into tMax
> if tArray[ tMin ] < tArray[ tMax ] then
> put tArray[ tMin ] & tab & tMin & cr after tResult
> put tArray[ tMax ] & tab & tMax & cr after tResult
> else
> put tArray[ tMax ] & tab & tMax & cr after tResult
> put tArray[ tMin ] & tab & tMin & cr after tResult
> end if
> put 0 into tLineNumber
> put empty into tArray
> end if
> end repeat
> return tResult
> end digest
> </postScript>
>
>
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
More information about the use-livecode
mailing list