Convergence using find?

Dar Scott dsc at swcp.com
Wed Apr 7 17:28:34 EDT 2004


Or...

Use sort with a special sorting function and then get the first line.

sort lines of myList ascending numeric by abs((item 1 of each)-n)
get line 1 of myList

(I'm assuming item 1 is the number and other items are the data you 
need to go with the number.)

I don't know if this would be faster than the brute-force loop.

Dar Scott



More information about the use-livecode mailing list