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

dunbarx at aol.com dunbarx at aol.com
Tue Oct 13 00:07:57 EDT 2015


Geoff.


I find this slower than the sort method. By about 30%.


Craig



-----Original Message-----
From: Geoff Canyon <gcanyon at gmail.com>
To: How to use LiveCode <use-livecode at lists.runrev.com>
Sent: Mon, Oct 12, 2015 9:11 pm
Subject: Re: function for greatest object in list less than or equal to a value


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 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