Code: Select all
put "hello" after char -1 of fld 1
When I say:
Code: Select all
put the name of fld 1 into tName
put hello after char -1 of tName
What is the obvious answer?
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Code: Select all
put "hello" after char -1 of fld 1
Code: Select all
put the name of fld 1 into tName
put hello after char -1 of tName
Code: Select all
after char -1 of fld 1
Code: Select all
before fld 1
Code: Select all
set the name of field 1 to "test2"
Code: Select all
put "hello" after char -1 of fld 1
Code: Select all
put "hello" after fld 1
in that case it's simple indeed.
Code: Select all
on mouseUp
put "Hello " before field 1 -- note the space after 'Hello'
end mouseUp
Code: Select all
on mouseup
put "hello" after the target
--possibly put space & "hello" after the target
--or, for example, put "Hello" before word 2 of the target
end mouseup
Code: Select all
put the ID of the target into tID
put hello after fld ID tID
Craig, the OP already stated that the end-user is expected to enter text, hence cannot be locked. ExitField and CloseField are the next best option.dunbarx wrote: ↑Tue Aug 02, 2022 3:44 pmMuch simpler, I think, and a great lesson to boot, is to learn the use of "the target". Assuming your fields are locked:LC "knows" which field you have clicked on, and the target contains all the information it needs to act.Code: Select all
on mouseup put "hello" after the target --possibly put space & "hello" after the target --or, for example, put "Hello" before word 2 of the target end mouseup
Know also about "target" (without "the") which returns the field contents, and is not an object reference.
Craig
Code: Select all
on closefield
local tText, tStandardText
put the uStandardText of me into tStandardText
if tStandardText is in the text of me then pass closeField
put the text of me into tText
put tStandardText & space before tText
set the text of me to tText
pass closeField
end closefield