Position of cursor in plaintext field

Hi everyone,

I’m trying to insert text at the cursorposition of a plain textfield. Is there a way to find out the current numerical position of the cursor in the textfield (so afterwards I can put my new text together with “textleftofcursor” and “textrightofcursor”). I know about the uidoc.inserttext method, but that is not an option for me (no richtext)

Thnx,

Arthur

Subject: position of cursor in plaintext field

Try @Command( [EditInsertText] ; string )

Regards

Litty Joseph

Subject: RE: position of cursor in plaintext field

Sorry Litty, i was a little bit to fast.The @Formula does work with plain text also

I just still have the problem of where to put the code.

When I put it in a button on my form I will loose focus and it won’t work. Only solution is using a form-action.

Anyone outthere can tell me how I can use form-actions in a dialogbox?

Arthur

Subject: RE: position of cursor in plaintext field

Sorry, same problem different language!

Thing is that both functions (@Command( [EditInsertText] ; “txt” ) and uidoc.inserttext work fine when:

A: your field = richtext

B: your form != dialogbox

Both are not the case…

Thnx anyhow

Arthur

Subject: RE: position of cursor in plaintext field

Since you have now revealed that your form is displayed in a dialog, I think we can determine that the problem has nothing to do with whether the field is rich text. The user must activate your code by clicking some control in the dialog. And since you have no action buttons in a dialog, when they click a control they are also exiting the field. Therefore, you no longer have a position in the field.

I suppose you could do something with the exiting event of the field, e.g. you could insert some text at that time that you could search for and replace in your button. But that’s a little dodgy, especially since you can exit the field without clicking the button.