S - Search and Replace
Replaces one character string with another.
Command
S
Action
Press S. The Status/Command Line prompts:
CS SEARCH for:
Note
CS
indicates that the search will be
case-sensitive. Use the = command to toggle
between case-sensitive and -insensitive.
Enter the string to be located and replaced (the SEARCH string). The Status/Command Line prompts:
REPLACE with:
Enter the replacement string. The Status/Command Line prompts:
REPLACE (A)ll, (S)elective:
-
Press A to replace all occurrences of the SEARCH string with the REPLACE string. This includes replacing multiple occurrences on the same line.
-
Press S to selectively replace each occurrence of the SEARCH string. The program locates each occurrence of the SEARCH string and prompts you whether or not to replace it.
You must press either A or S; there is no default value for this selection. The Status/Command Line then prompts:
Thru line# Ret=current, 0=Exit
Enter a line number. The program searches from the current line to the line number specified. Press RETURN for only the current line. Press 0 (zero) to exit the search and replace routine.
If you press S for selective replacement, the Status/Command Line prompts:
(R)eplace (Q)uit (Return)=Next
-
Press R to replace the string and move to the next occurrence.
-
Press Q to quit the search.
Press RETURN to skip this occurrence and go to the next one.
Case sensitivity
You can choose whether the R command matches strings in a case-sensitive or -insensitive way. For example, if you search for "FRED", this will match "Fred", "FRED" and "fred" if the search is case-insensitive but only "FRED" if it is case-sensitive. Whether searches are case-sensitive or -insensitive can be selected as follows:
-
You can select the required mode when you start the screen editor with the U (sensitive) or Y (insensitive) option. If you use neither of these options, the current data case setting is used (set with the DATA.CC environment option or the CASE TCL command).
-
You can change the case setting with the = screen editor command.
Note that, if you are editing multiple items, the current setting is retained when you open a new item.