function for greatest object in list less than or equal to a value

Mike Doub mikedoub at
Mon Oct 12 21:20:02 EDT 2015

Pass by reference and you can eliminate a memcopy on the initial function call.

-= Mike 

On Oct 12, 2015, 9:11 PM, at 9:11 PM, Geoff Canyon <gcanyon at> wrote:
>Not quite as concise, but this function is about 3x faster:
>function greatestLessThan pList,V
>   put empty into R
>   repeat for each item i in pList
>      if i < V and i > R then put i into R
>   end repeat
>   return R
>end greatestLessThan
>use-livecode mailing list
>use-livecode at
>Please visit this url to subscribe, unsubscribe and manage your
>subscription preferences:

More information about the use-livecode mailing list