[ First ]  [ Previous ]  [ Next ]  [ Last ]  [ Manuals ]


Finding and Replacing Text

To find and replace text in a single file, you open the Find and Replace dialog box, enter search text, configure search criteria, and then perform the search. After a successful search, you can replace matching text located by the IDE.

To find and replace text using the Find and Replace dialog box, follow these steps:

1. Choose Search > Find and Replace.

2. Enter in the Find field the text to find.

For example, to find occurrences of the text main, enter main in the Find field.

3. Enter in the Replace field the text to substitute for each occurrence of the text in the Find field.

4. Configure the search criteria.

See "General Search Options", "Multi-File Search Options", and "Searching with Special Characters" for more information.

5. Find and replace individual matching occurrences of text, or find and replace all matching occurrences, in the active editor window.

For more information about finding and replacing individual occurrences, see "Selective Find and Replace." For more information about finding and replacing all occurrences, see "Replace All".

To learn how to find text in the active editor window without replacing matching text, see "Finding Text".


Selective Find and Replace

To find and replace individual occurrences of text, you must first complete the steps described in "Finding and Replacing Text." After completing those steps, continue with the additional steps described in this section.

To selectively find and replace text, follow these steps:

1. Click the Find button in the Find and Replace dialog box, or choose Search > Find.

Using the search text in the Find field and the search criteria defined in the Find and Replace dialog box, the IDE searches the active editor window for matching text. If successful, the IDE closes the Find and Replace dialog box, then displays and selects the matching text in the editor window. If unsuccessful, the IDE beeps.

2. Choose the desired menu command from the Search menu.

Choose the menu command that performs the desired task:


NOTE

(Windows) The IDE disables the Replace and Find Previous menu command by default. See "Customizing Commands" to learn how to enable the menu command.

You can repeatedly choose the Replace and Find Next or Replace and Find Previous menu commands to continue replacing and finding other matches. The IDE beeps after failing to locate additional occurrences.


Replace All

To replace all occurrences of matching text, you must first complete the steps described in "Finding and Replacing Text". After completing those steps, click the Replace All button in the Find and Replace dialog box. You can also choose Search > Replace All if you wish to use the existing criteria in the Find and Replace dialog box.


WARNING!

You cannot undo Replace All. However, if you save the file prior to using Replace All, you can use Revert to restore the file to its original state. This technique works as long as you do not save any changes after using Replace All, and you do not work across multiple files.

[ First ]  [ Previous ]  [ Next ]  [ Last ]  [ Manuals ]

Visit the Metrowerks website at: http://www.metrowerks.com
For assistance contact Metrowerks Technical Support at: cw_support@metrowerks.com
Copyright © 2000, Metrowerks Corp. All rights reserved.

Last updated: August 17, 2000