In the previous chapter we have seen how MemoSearch can help you find what you're looking for in a flash. In this chapter we will examine the more classic method of text search.

 

The Memo Find and Replace functionality is encompassed in Alventis by 3 commands and 2 dialogs:

BarIfxFindInMemo Find in Memo which opens the Find dialog

BarIfxReplaceInMemo Replace in Memo which opens the Replace dialog

BarIfxFindNextInMemo Find Next in Memo which doesn't have a dialog, poor thing

 

The Find dialog is depicted below.

 

FindAndReplace1A

 

The Find combo box is of course where you specify what text you are looking for. No regular expressions or formatting here, sorry. Just good old plain text. This is an MRU Combo Box though, so it will remember your recent searches.

The Global checkbox, when checked, will perform the search on the entire text of the Memo. Otherwise, it will start at your current cursor position in the Memo.

The Case sensitive checkbox forces the search to only find exact matches where character case is as you specified.

The Across line breaks checkbox makes the search ignore a line breaks if one is found between the words of the search expression you have specified. Could be useful if your Memo contains text with lots of manual line breaks at the end of every line as is frequently the case with e-mails.

Close dismisses the dialog.

The Find button starts the search.

 

Once a match has been found in the Memo, you can stop the search using the Cancel button (the one that used to say Close) (if you've found what you're looking for). You can attempt to locate the next match by clicking the Find Next button (which used to say just Find). You can highlight the found occurrence with the Color (which you select using the so called button) by clicking the Mark button, which automatically continues the search on to the next match, if any. Highlighting has been described in the MemoSearch chapter.

 

FindAndReplace1B

 

During a search, you can adjust whatever the dialog will let you, e.g., the search expression in the Find combo box. The search will continue with the updated text.

If you cancel the search in progress, you do just that: cancel the on-going search. This gives you an opportunity to perform another search without closing the dialog. If the search is Global, it will restart at the beginning of the Memo. If not, it will proceed from where you left off with the preceding search.

You can also perform a search on just the selected Memo text. You do so by first selecting the text, and then invoking the Find dialog.

 

 

The Replace dialog is quite similar to the Find dialog:

 

In fact, the only differences are:

The Replace MRU Combo Box is of course where you specify the replacement text.
The buttons related to match Marking are not appropriate here, and so have been replaced by Replace All and Replace.

 

FindAndReplace1D

 

The general procedure is the same as before:

Specify the Find and Replace text and set the checkboxes up as you like

Hit the Find button to initiate a search

If a match is found:

Hit Replace All to replace this and all subsequent matches without any prompting
Hit Replace to replace just this match and proceed with the search
Hit Find Next to skip this match and try to locate another one

 

Everything we said about the Find dialog also applies here: you can perform multiple search/replace sequences without closing the dialog, you can modify whatever it will let you during a search (including, yes, both the Find and Replace text strings), and you can perform all that in a selection.

 

 

Finally, the Find Next in Memo button simply repeats the last Find operation. It simply goes from the current cursor position in the forward direction. If you haven't performed any Find/Replace operations yet since you have launched Alventis, it won't know what search to repeat, so it will simply open the Find dialog.