Klaus wrote:Hi monki,
just made a test with LC 8.1.2 RC2 on my Mac.
A field and a button and your script in the group script.
Since there is no "tabdown" message in LC I used "on tabkey"!
I got the exspected correct results!?
What OS and LC version are you using?
Best
Klaus
My apologies, it is
tabKey in the script not tabDown. I wrote a keyDown handler just before posting the message so that was stuck in my mind, but yeah, it's tabKey. I'm running LC 8.1.2 RC2 as well.
I changed the code to pull word 2 from "it" rather than re-run selectedChunk
Code: Select all
function findCursorPositon
local tSelectedChunk
put the selectedChunk into it
put word 2 of it into tSelectedChunk
return tSelectedChunk
end findCursorPositon
and got following variables
Code: Select all
it = char 226 to 257 of field 2
tSelectedChunk = 226
So selectedChunk is spitting out something new each time it's run from the same handler.
This is fun. I called the code from a button using "dispatch", it works fine. It's part of a handler that marks the insert position in the field, so I know it's correct. But I put a breakpoint at "findCursorPosition", it starts returning the wrong "char 226 to 257 of field 2" again, no matter where the insert is located in the field.
So I remove the breakpoint and run the whole script again using the button, including the method that calls "findCursorPosition". It somehow calls an unrelated handler which isn't part of anything it's working with, and fails there. Something's messed up. Maybe I should just delete LC, reinstall from a fresh download, and see if that fixes it.