The position of a typed character.

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
Fermin
Posts: 149
Joined: Fri Jun 05, 2015 10:44 pm

The position of a typed character.

Post by Fermin » Sat Apr 30, 2016 11:39 pm

Hi. Is there any function to find the position (chunk) of a character in a string as you type ?.

For example, if I click anywhere in the text of a field (not necessarily at the end, which would be easy) and write 'HOUSE', I would like to know the chunk of all the characters H-O-U-S-E as they are entered.

As far as I know, functions as clickCharChunk or selectedChunk report only on the first character (where the click, the H in the example) but not on others.

Thank you very much in advance.

paul_gr
Posts: 319
Joined: Fri Dec 08, 2006 7:38 pm

Re: The position of a typed character.

Post by paul_gr » Sun May 01, 2016 1:09 am

Hi Fermin,
See attached. Look at script on field "fldInput"

Paul
Attachments
CharPosition.zip
(715 Bytes) Downloaded 206 times

Fermin
Posts: 149
Joined: Fri Jun 05, 2015 10:44 pm

Re: The position of a typed character.

Post by Fermin » Sun May 01, 2016 1:53 am

Great, Paul. I was wrong, the selectedChunk works perfectly. Also in my messages 'on textChanged' and 'on keydown'.
Thank you very much for your help.

Post Reply