Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 6548 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Middle( text ; Get ( ActiveSelectionStart ) ; Get ( ActiveSelectionSize )) gives the text of the selection.

LeftWords(

Right( text ; Length( text ) - Get ( ActiveSelectionStart ) - Get ( ActiveSelectionSize ))

; 1)

give the following word. If nothing is selected it gives the first word.

-jens

  • 2 months later...
Posted

... Sounds right...

Middle( textField ; Get ( ActiveSelectionStart ) ; Get ( ActiveSelectionSize )) & " " &

LeftWords(

Right( textField ; Length( textField ) - Get ( ActiveSelectionStart ) - Get ( ActiveSelectionSize ))

; 1)

... should work exactly as you want .. pretty smart too, would've taken me like half an hour to work that one out.

Why don't you test it and tell us if it works?

Posted (edited)

It is correct in the sense that it gets the FOLLOWING word, as stated. If you want the selected word AND the following word, you can change it to:

LeftWords ( Right ( text ; Length ( text ) - Get ( ActiveSelectionStart ) + 1 ) ; 2 )

---

Note that this assumes that the selection starts at the beginning of a word, or that the cursor is at the beginning of a word.

Edited by Guest

This topic is 6548 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.