PDA

View Full Version : Search and Replace


ian807
July 19, 2007, 18:34:05
Enhanced Search and Replace with:

1) Dialog visibility and use as an optional argument. I DON'T mean the error dialog which can already be turned off, I mean the main dialog for which I have no use.

2) Whole word only search and replace.

3) Regular expression search and replace.

The current method of find, select and replace selection is so slow, clunky and error prone (try it around line endings) that I'd prefer it be built-in. This may not seem like an important feature (Microsoft didn't think search was important in XP either), but if if happens to be central to your application, this gets very important. We almost didn't purchase TX Control again based solely on the weaknesses of the current search and replace features.

Regards,
Ian

Björn Meyer
July 20, 2007, 09:59:55
Hello Ian

Thanks for your feedback.

1. I am not sure about this issue. You can use the Find method without the dialog. The text can be replaced using the Selection.Text property. Did I miss something?

2. Good point.

3. How about using the Text property of TX Text Control and the RegEx methods from .NET? I don't see a reason why to encapsulate the RegEx again in TX Text Control. Did I miss something here as well?

Björn

ian807
July 20, 2007, 16:11:09
>You can use the Find method without the dialog. The text can be replaced using the Selection.Text property. Did I miss something?
This works, but it's slow and problematic, particularly around line endings, and the first and last words of a document, where I can't get it to work reliably (The guys in India gave up too).
Actually search and replace is easy if you are only concerned with strings don't mind losing the formatting. As you know, .net has excellent methods for string manipulation, regex, among them. Customers, however, are somewhat touchy about the loss of their bold, italic, styles and such.

I could start parsing the rtf, but that's it's own expensive nightmare.

The design choice to make search and replace using a dialog box that I can't control, is, from my point of view, unfortunate; I'd rather have a more flexible method that allows me full search and Replace functionality, but leaves the dialog as an optional argument, or skips it entirely. Dialogs are easy, after all.