scroll-to-letter in sorted list
Charles Hartman
charles.hartman at conncoll.edu
Fri Nov 11 23:48:03 EST 2005
I'm sorry, I can't remember who posted the nifty partial solution to
incremental searching in a sorted list in a field: scroll to the
first item that begins with whatever letter the user presses. I've
made a microscopic improvement to take care of the case in which no
item begins with the letter pressed:
on keyUp theKey
if theKey is "a" then
set the scroll of me to 0
exit keyUp
end if
put lineOffset(CR & theKey, me) into lo
repeat while lo is 0
put numToChar(charToNum(theKey) - 1) into theKey
put lineOffset(CR & theKey, me) into lo
end repeat
set the scroll of me to lo * the effective textHeight of me
end keyUp
Charles
More information about the use-livecode
mailing list