The information in this article applies to:
- Microsoft Windows operating system versions 3.0, 3.0a
SUMMARY
Microsoft Windows 3.0 Notepad has no search-and-replace function. You
can, however, make a small macro to get around this by using the macro
recorder included with the Windows retail package.
MORE INFORMATION
Creating the Macro
The steps to create this macro are as follows:
- Load Recorder as an icon by pressing SHIFT while double-clicking
your mouse on the Recorder icon within the Program Manager.
- Open the file you want to edit within Notepad.
- Type a string that you would like to use to replace the current
string in the file. (For example, if you want to replace "Rename"
with "REM," type "REM"). After typing the string, select it with
the mouse or press SHIFT+<an ARROW key>.
- From the Edit menu, choose Cut.
- Move to the point in the file that you want to start the search
(normally at the top).
- From the Search menu, choose Find.
- Type the string that you want to replace.
- Press ENTER (this should highlight the first occurrence of
the string).
- Double-click the Recorder icon.
a. From the File menu, choose New.
b. From the Macro menu, choose Record.
c. Enter a name for the macro.
d. Choose a hot key that will not conflict with other keys used by
Notepad (for example, ALT+BACKSPACE).
e. Select Start.
- Recorder will record keystrokes only by default, unless you change
it.
- Press DEL, then SHIFT+INSERT, and then F3 (this should replace the
first occurrence of the word and find the next).
- Press CTRL+BREAK (this will stop the recorder).
- Choose Save.
- Use the hot key to play back the macro and replace the rest of the
occurrences of the string.
Using the Macro
When you want to use the macro later, do the following:
- Run Recorder.
- From the File menu, choose Open, and select the macro you created.
- Run Notepad and open the file.
- Type a replacement string.
- From the Edit menu, choose Cut to place the string in the
Clipboard.
- Go to the place in the file that you want to start the search.
- From the Search menu, choose Find and select the string you want to
replace.
- Type the hot key that you used in step 9d in the "Creating the
Macro" section (each time that you press this, it will find the
next occurrence of the string and replace it).
REFERENCES
"PC Magazine," April 16, 1991, page 356, "Search-and-Replace Mission"
|