How do I insert text at the cursor in a text area box?

What I want to do is press a button and have it put a fixed_text like ( " [^.^] " at the cursor location in a text area box.

I can easily place it before the text in the area textbox or after it. ( TextAreaBox.Text = fixed_text + TextAreaBox.Text or TextAreaBox.Text = TextAreaBox.Text + fixed_text ) but I don’t know how to put it at the cursor location.

The best I can do is a two step procedure. Step 1 is to put the (fixed_text) on the clipboard and then step two is to manually paste it at the cursor location. (cntrl +V)
I want to do it all in one step.

Any ideas on how I can do it?
I’m running XOJO 2017r1.1

Thanks for any help or comments you can give me.
Dave

textarea1.selstart=whereyouwanttoinsert
textarea1.seltext="insert this text"

That would work but the cursor will not always be at the same spot in the text.

Sorry I should have mention that.

Is there a way to find out where the cursor is at in the text?

Dave

SELSTART is the cursor position

Thank you so much.

txaBibleComments.SelStart = txaBibleComments.SelStart
txaBibleComments.SelText = “[^.^]”

It works perfectly.
Thanks again.

I’ve used SelStart before bur it was always to put the cursor where I wanted.
This have opened up a whole new way of looking at some things.
Dave

redundant

Wow! That makes it even better.

Dave

PS: Whatever happened to the “Classic Language Reference Help” I could find things in it and I mess it.

The Wiki? Until they remove it I’ve been using the editing history to see the old entries.