CHANGE [ HPTOOLSET XL Reference Manual ] MPE/iX 5.0 Documentation
HPTOOLSET XL Reference Manual
CHANGE
Allows you to change specific strings or column ranges in the edit file.
Can be deactivated with the UNDO command.
Syntax
CH[ANGE] [ [ALL] find string] [TO] change string [ [IN] line range]]
[ [ ,] [ ,] ]
[ [col pos[:col pos]] ]
[Q[UIET]]
Parameters
ALL Causes all occurrences of the find string within the
line range to be changed.
Find String Defines the string of text you want to change. By
default, only the first occurrence of the find string
will be changed. Strings must be delimited with single
or double quotes or brackets.
If the string is delimited with double quotes, only
occurrences surrounded by one or more spaces or by
punctuation will be found. If delimited by single
quotes, all occurrences will be found. Strings
delimited by brackets affect both upper and lower case
occurrences.
Column Position Defines a column range that you want to change.
F[IRST] denotes the leftmost accessible column. L[AST]
denotes the rightmost accessible column. For COBOL
files, FIRST represents column 7. For Pascal and other
files, FIRST represents column 1.
Change String Is the replacement text. This string must be delimited
by single or double quotes or brackets.
Line Range The range of lines that will be searched for the find
string. By default, the current line will be searched.
Has the format n[/n], where n could be a line number,
F[IRST], L[AST], *, or an expression involving any of
these and a plus sign (+) or minus sign (-). The *
means the current line. For example, L - 10/L would
print the last 11 lines of the file; * + 5/20, if the
current line is 3, would print lines 9 through 20.
QUIET Suppresses output to $STDLIST.
Description
When the CHANGE command works in conjunction with the FIND command, only
the CHANGE TO string portion of the syntax needs to be used. This method
of changing text assumes that a FIND command has been entered.
TOOLSET/XL remembers the find string and where it was until a new FIND
command is entered or until you specify a new find string in the CHANGE
command. The Change function key utilizes this method of defining the
find string with the Find key so that when Change is pressed, you need
only enter the replacement string. To use the CHANGE command without an
associated FIND command, you must enter both the find string and the
change string parameters (the string to be changed and the replacement
string).
When the CHANGE command is entered without any parameters, TOOLSET/XL
prompts for the change string. If there is a previous change string, it
is displayed in parentheses and can be re-used by pressing the carriage
return.
If the change causes a line of text to be longer than the record length
of your file, the line will be truncated.
Example
>>CHANGE ALL 'ARRAY' 'RECORD' IN 50/75
54 ABC : RECORD [1. .10] OF CHAR:
58 INTRECORD : ARRAY [1..100] OF INTEGER;
58 INTRECORD : RECORD [..100] OF INTEGER;
63 ERR_CAUSE : RECORD[1..5] OF PACKED ARRAY[1..60] OF CHAR;
63 ERR_CAUSE : RECORD[1..5] OF PACKED RECORD[1..60] OF CHAR;
>>
>>CHANGE 15:20 TO "MOVES" IN 200/210
200 MOVES FILE1 TO FILE1X
201 MOVES FILE2 TO FILE2X
202 MOVES FILE3 TO FILE3X
203 MOVES FILE4 TO FILE4X
204 MOVES FILE5 TO FILE5X
207 MOVES FILE10 TO FILE10X
208 MOVES OLDFILE TO NEWFILE
>>
>>FIND 'OLD' IN ALL
208 MOVES OLDFILE TO NEWFILE
>>CHANGE TO 'NEW'
208 MOVES NEWFILE TO NEWFILE
>>
MPE/iX 5.0 Documentation