Is it possible to put text in a field at a position other than that defined by the keywords 'before', 'after' or 'into'.
The background is that I'm trying to create a 'synonym' function, eg if I type in 'lidsa' then i would like the 'lidsa' to be replaced by 'Lorem ipsum dolor sit amet' at the cursor position.
At the moment I'm solving it with this workaround which of course works only for the last word in the field:
Code: Select all
on keyup
if the last word of fld"Notes" is "lidsa" then
replace the last word of fld"Notes" with "Lorem ipsum dolor sit amet" in fld"Notes"
-- above will replace the text but will put the cursor unhelpfully at the beginning of the field!
-- the following code will put the cursor at the end of the field so I can continue typing!
set the vScroll of fld"Notes" to the formattedHeight of fld"Notes"
put " " after fld"Notes"
end keyup
end if
Grateful for any hints.
Many thanks,
Glenn