AnsweredAssumed Answered

Programmatic text insert at cursor location - how might this be done in FMP?

Question asked by mattb on Dec 22, 2012
Latest reply on Dec 22, 2012 by mattb

Title

Programmatic text insert at cursor location - how might this be done in FMP?

Post

     I would like to be able to programmatically insert text in an existing text field at the cursor's current location .  Problem is that I don't see any FMP functions that would return the value of the cursor's current position in a field.  If I were able to ascertain that number, then I would use Left, Middle, and/or Right functions to insert the text at the proper location, i.e. splitting the existing text, with the programatically inserted text in between, and then using Set Field.  Currently I'm only able to insert programatically inserted text at the end of an existing text field, initiated by a mouse click on another text field that runs a script. 

     Background:  I'm the developer of a cross-platform application, the Windows version is written in Visual Foxpro and the Mac version in FMP.  The way I accomplish this in VFP is using their "KEYBOARD" command which simply stuffs the keyboard buffer with the predetermined text, and when activated by a hotkey or mouse click, it inserts the predetermined text at the cursor's current location in the text field, which then pushes any existing text past the cursor's location to be below the inserted text.  In this case, VFP doesn't even know the current position of the cursor in the field, but it doesn't matter, because the KEYBOARD function just inserts the text wherever the cursor is.

     Any ideas on how to accomplish this same task in FMP?  I'm thinking if FMP can provide me with a number that represents the cursor's current position in a text field, I could do it, but short of having that vital piece of info, I'm stumped.  Any suggestions?

      

      

      

      

      

      

Outcomes