Re: Inserting a character at the text insertion point in a field

2015-04-28 Thread Peter Haworth
Thanks for that Paul, learned something new, yet again! Pete lcSQL Software Home of lcStackBrowser and SQLiteAdmin On Tue, Apr 28, 2015 at 12:26 PM, Paul Hibbert wrote: > Or another way, re

Re: Inserting a character at the text insertion point in a field

2015-04-28 Thread Richmond
On 28/04/15 22:06, Tore Nilsen wrote: I try to make a script in a field to allow only numbers or the decimal sign to be entered into the field. To block any other key is easy, but I have run into problems when I try to insert the decimal sign at the text insertion point in the field. This scr

Re: Inserting a character at the text insertion point in a field

2015-04-28 Thread Tore Nilsen
This gets better and better! The last solution seems to cover all eventualities! Thank you! Tore > 28. apr. 2015 kl. 21.26 skrev Paul Hibbert : > > Or another way, replace… > >> put "." after me > > …with: > > put "." into the selection > > Works OK here, and allows you to replace a n

Re: Inserting a character at the text insertion point in a field

2015-04-28 Thread Paul Hibbert
Or another way, replace… >put "." after me …with: put "." into the selection Works OK here, and allows you to replace a number with a period if you typed it wrong. Paul ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit

Re: Inserting a character at the text insertion point in a field

2015-04-28 Thread Tore Nilsen
Thank you! It did the trick nicely. Sometimes the solution is just too easy! In Norway comma is used as a decimal sign, and this way my students can make a script that will allow the user to write whatever decimal sign they choose. Tore > 28. apr. 2015 kl. 21.17 skrev Peter Haworth : > > Hi

Re: Inserting a character at the text insertion point in a field

2015-04-28 Thread Peter Haworth
Hi Tore, You'll need to to use the selectedChunk property of the field. Check out the dictionary entry for it but as long as no text is selected in the field, replace your put statement with: put word 4 of the selectedChunk of me into tPos put "." after char tPos of me Pete lcSQL Software

Inserting a character at the text insertion point in a field

2015-04-28 Thread Tore Nilsen
I try to make a script in a field to allow only numbers or the decimal sign to be entered into the field. To block any other key is easy, but I have run into problems when I try to insert the decimal sign at the text insertion point in the field. This script only allows me to insert the decima