![]() |
|
#1
|
|||
|
|||
|
Howdy,
I've inheritied an older app. which is using a 3rd party replacement for RichEdit: TWPRichEdit (WPTools, ver 4.22a). I'm attempting to add some new functionality which will allow formatting based on selected (highlighted) text. With the above in mind, I've noticed the following while debugging: 1. When the entire contents of my richedit is selected, the value of Text property is not equal to the value of the SelText property. 2. Here is an example to show the diff.'s between the Text & SelText property contents: Memo.Text := 'TableName, '#$D#$A'' Memo.SelText := 'TableName, '#$D'' My questions: Where is the (above) #$A text coming from in the Text propery and why isn't it also present within the SelText property? Thanks for any & all help, |
|
#2
|
|||
|
|||
|
Just to clarify, so I am sure I am understand what you are asking.. If you enter
"Please excuse my dear aunt sally" [Without the quotes] Into the rEdit/Memo, and you select all of it, and you execute something like: Showmessage('|'Memo.Text + '/' + Memo.SelText + '|'); You would see a message box reading: |Please excuse my dear aunt sally#$D#$A/Please excuse my dear aunt sally#$D| Is that correct, or am I misunderstanding?
__________________
"not quite smart enough to be dumb" Extended Stats No Longer Available Due To Changes To The Forum.
|
|
#3
|
|||
|
|||
|
Howdy,
Thanks for the interest & post. And yes, you are correct. In the logic I was writing with this app, I wanted to determine if the "entire" contents of a memo were highlighted. I found simply attempting 'If (Memo.Text = Memo.SelText) Then' wasn't working. My temp solution was to create a simple routine to strip out any '#$D' & '#$A' char's from both Memo.Text and Memo.SelText and then compare the two. While the above allowed me to move on with my little project, I still don't know where the extra '#$A' char's were coming from. Since I'm really new to using this TWPRichEdit comp, I'm guessing (and only guessing) it might be some property setting within the TWPRichEdit comp ... Thanks, |
|
#4
|
|||
|
|||
|
I believe that you are correct, I am guessing that you found the post on StackOverflow containing a simple way to remove the line end / CRLF.
NumChars := Length(StringReplace(RichEdit1.Text, sLineBreak, '', [rfReplaceAll]));
__________________
"not quite smart enough to be dumb" Extended Stats No Longer Available Due To Changes To The Forum.
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|