Page 1 of 1
How to use GetSelText without delete selected text ?
Posted: Thu Dec 15, 2005 2:54 pm
by Benoit B.
Hi,
all is in the title
In fact I use SelectCurrentWord and GetSelText to know the value of the current text. The problem with this method is the word is delete.
thank.
Posted: Thu Dec 15, 2005 3:20 pm
by Sergey Tkachenko
No, GetSelText does not delete the selection.
Something else does it
Posted: Thu Dec 15, 2005 4:36 pm
by Guest
You're right,
But how to have set and get the position of the caret.
In fact, i want to save the position before the SelectCurrentWord and insert it in his old position after the GetSelText.
Thank.
Posted: Thu Dec 15, 2005 4:37 pm
by Benoit B.
Sorry, I've forgot to write my username
Posted: Thu Dec 15, 2005 6:05 pm
by Sergey Tkachenko
Do you want to insert something before the selection?
Posted: Fri Dec 16, 2005 8:23 am
by Benoit B.
Hi,
I want to take the value of the word for a comparaison with database and continu to write.
For exemple, if I do a space in a middle of a word, i would to take his value before do the space and do it after. But if I do SelectCurrentWord, I can go only before or after the word to do the space, and not in the position of the caret before the SelectCurrentWord .
Do you know my problem ?
Thank
Posted: Fri Dec 16, 2005 2:16 pm
by Benoit B.
It's good, I've find.
Thank for all.
Posted: Fri Dec 16, 2005 5:47 pm
by Sergey Tkachenko
For any case,
If you want to store selection, then change selection, then restore selection, use RVGetSelectionEx and RVSetSelectionEx from RVLinear unit.
But it's not necessary to select word to read its value. For example,
function GetCurrentWord(rve: TCustomRichViewEdit): String; from RVGetText.pas returns the current word (the same Unicode function exists in RVGetTextW.pas)