replace char at cursor
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
-
- Posts: 73
- Joined: Sat Apr 08, 2006 6:51 pm
replace char at cursor
How does one replace the char at the cursor in a field with the char typed instead of inserting the char typed?
In nova fert animus mutatas dicere formas corpora.
From an amateur (me) - this question was a good learning experience 
I put this in the field (named "fText") script:
The selected chunk returns "char n to char m of field k" where n (word 2 of selectedChunk) is the character after the insertion point and m (word 4 of selectedChunk) the character before.
I imagine there might be a better way, like a global parameter or field property, but I couldn't find one.
Good luck,
Walt

I put this in the field (named "fText") script:
Code: Select all
on keydown theKey
put word 2 of the selectedChunk into afterChar
put theKey into char afterChar of field fText
end keydown
I imagine there might be a better way, like a global parameter or field property, but I couldn't find one.
Good luck,
Walt
Last edited by WaltBrown on Mon May 25, 2009 5:22 am, edited 1 time in total.
Walt Brown
Omnis traductor traditor
Omnis traductor traditor
-
- Posts: 73
- Joined: Sat Apr 08, 2006 6:51 pm
insert char
Exactly what I needed. Thanks so much!
In nova fert animus mutatas dicere formas corpora.