Search-And-Replace Operations - HP 9000 200 Series Manual

Using the basic 5.0/5.1 system
Table of Contents

Advertisement

Search-and-Replace Operations
The CHANGE command is similar to FIND, except that you will specify both a search
pattern and a replacement pattern.
The following example searches for the pattern "Old texf' and replaces it with "New
characters" :
CHANGE "Old text" TO "New characters"
I
Return
I.
Likf' with FIND. thf' systf'm shows that it is busy searching for a pattern:
Finding "Old text"
Also like FIND. the CHANGE command pauses when it finds the first occurrence of the
sf'arch pattern: however. ('HANCE also rf'places thf' old pattf'rn with the new one. and
awaits your confirmation/rejection of the change:
200
PRINT "New characters."
"Old text" to "New characters"?
• Like FIND, you can edit the line first. To confirm the change, press
I
Return
I .
• To reject the change, press I
CONTINUE
I
(@J
in the System menu of an ITF keyboard).
If you want only the occurrences of the pattern in a certain program segment to be
changed, then use the following syntax:
CHANGE "old" TO "New" IN 1, 250
If you want all occurrences of the pattern changed. with no capability of interactively
confirming/rejecting the changes, use the following syntax:
CHANGE "old" TO "New" ; ALL
You can also combine these two specifications to change all occurrences within a range
of lines:
CHANGE "old" TO "New" IN 1, 250; ALL
6-24
Editing and Storing Programs

Advertisement

Table of Contents
loading

This manual is also suitable for:

9000 300 series

Table of Contents