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

Dr. Hawkins dochawk at gmail.com
Sun Oct 11 12:15:52 EDT 2015


It would be nice to have an intrinsic for this, but I just read the entire
function list . . .

I need to find the largest number in a list which is smaller than a
specified value.

e.g., for the list "1,3,4,7,9" and 5, the largest such value would be 4.

In a spreadsheet, I could use use vlookup() and specified the index as the
row to return.

In a database, could " SELECT MAX(myVar) WHERE myVar<5;", and so forth

I  had thought that FILTER could take a]b arbitrary function, but
apparently not. t It could conceivably use a rgexp, but calling a regex for
numeric comparison "ugly" would be polite

I'm not seeing anyhing better than lo better than looping through at the
moment
-- 
Dr. Richard E. Hawkins, Esq.
(702) 508-8462



More information about the use-livecode mailing list