This was an issue in another thread on the beginner's forum.
Given a field with text on several lines, and for the purpose assume that all entries start with the same char, say "a". In the field script:
Code: Select all
on keyDown var
find var in me
end keyDown
With that field in focus, pressing "a" on the keyboard will find each instance of the text. But when the last line is found, a new key press does nothing. Yet another key press will find the first line again, and so on. The "result", after that last "find" is, not surprisingly ,"Not Found". I made a kluge to fix this:
Code: Select all
on keydown var
find var in me
if the result <> "" then
select char 0 of me
find var in me
end if
end keydown
Works fine. My question is this, what is happening? When finding from another source, say the msg box, the "find" cycles what I would consider "normally", that is, round and around without a break, as many times as you care to press that key. I am used to the "find" command searching among cards without issue, the internal index continuing to "find" the next instance, and that index knows when the last card has been scoured, and dutifully starts over. There must to be a similar index watching the field, but it does not cycle as well at all.
Craig Newman