How to start this project...
adrian at clubtype.co.uk
Sun Oct 1 13:06:35 CDT 2006
Thanks for your suggestion. It did not work for me - reporting:
Type Function: error in function handler
Line put Lookupchar(char beforecharpos of me) into newbeforechar
The object field is "edtText" but if I change me to edtText
that throws up an error too. I am new to Rev and this kind
of scripting. Am awaiting delivery of Dans book in three weeks!
To explain a little more why the cursor position is important...
User entering text can be dealt with as keyDown.
But if User goes back and inserts cursor in an existing word,
I need to know what is either side so that those characters can
be matched against a list and replaced if necessary.
Hope that clarifies?
Thanks for your help,
On 1 Oct 2006, at 17:05, Martin Blackman wrote:
> Hi Adrian
> I don't fully understand what you're asking but you can check the
> cursor location with the selectedchunk property. eg. the following
> field script might be a starting point for replacing your before char:
> on keydown
> put word 4 of the selectedchunk of me into beforecharpos
> put Lookupchar(char beforecharpos of me) into newbeforechar
> put newbeforechar into char beforecharpos of me
> pass keydown
> end keydown
> On 01/10/06, Adrian Williams <adrian at clubtype.co.uk> wrote:
>> I'm new to Revolution (using 2.7.3 trial on Mac OS X)
>> and want to create both Mac+Win programs of the solution.
>> In a text field I want the User to enter text.
>> The useUnicode will be set to true for a double-byte font which
>> will be developed with special characters.
>> (Although I want to test this with any single-byte first).
>> As the User types each letter from the keyboard I need the program to:
>> 1. check which (if any) letters are BEFORE the cursor/insertion point
>> 2. check which (if any) letters are AFTER the cursor/insertion point
>> 3. REPLACE beforeCharacter, enteredCharacter and afterCharacter
>> from a table that has been prepared in advance.
>> For example, as the User enters text;
>> ABCDE is entered but needs to be replaced with additional characters -
>> Once entered, it may need to be corrected;
>> AggBhhC is already on-screen.
>> User places insertion point somewhere in the word and begins
>> entering more text, which again, must refer to the table for
>> I've looked at the relevant ways I think it should be done but as I'm
>> completely new to Rev, this is just beyond my scope at the moment.
>> A starting point would be very helpful if anyone can assist?
>> Adrian Williams
>> "Club Type"
>> use-revolution mailing list
>> use-revolution at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
Adrian Williams Design Ltd (trading as Club Type),
44 Mill Lane,
Surrey RH1 3HQ, UK
Telephone/Facsimile: 01737 643300
dFax (computer reception): 0870 0515681
International tel/fax (UK)+44 1737 643300
International dFax: (UK)+44 870 0515681
Email: adrian at clubtype.co.uk
More information about the use-livecode