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

Craig Newman dunbarx at
Wed Oct 14 18:27:15 EDT 2015


The param "3" would be added to the list. The sorted list would be:
"2,3,4". When the itemOffset finds the "3", the item just before it would be "2". That is how it works. To find the item just before itemOffset does.

This is faster than any of the "repeat for each..." variants I have seen here. The reason, as I stated earlier as an uninformed opinion, is that the low-level "sort" routine beats the high-level "repeat" routine. 


Sent from my iPhone

> On Oct 14, 2015, at 2:25 PM, Dr. Hawkins <dochawk at> wrote:
>> On Mon, Oct 12, 2015 at 6:35 AM, <dunbarx at> wrote:
>> My gadget adds the index in a parameter to the function. if it already
>> exists in the list, the addition is superfluous, but harmless.
> But if the search list is "2, 4", and the search value is 3, doesn't this
> return "3" rather than 2?
> -- 
> Dr. Richard E. Hawkins, Esq.
> (702) 508-8462
> _______________________________________________
> 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