CHANGE old TO new [IN first-line [,last-line] ] [;ALL]
Where:
old and new = string-literals
first-line and last-line = line-number | line-label
Usage:
CHANGE "Apples" TO "Oranges" IN 1200,1500
CHANGE "Delete this sentence." TO ""
CHANGE "better" TO "best";ALL
CHANGE "unquoted" TO """quoted"""
Description:
The CHANGE statement is an editor command that allows you to search and replace character sequences. The old and new string literals are used exactly as given with the case being significant.
The CHANGE command from the HTBasic Windows Editor input line brings up the FIND window and fills fields with old and new values. All other options are ignored.
If ALL is included in the CHANGE statement, then all changes are made automatically. If ALL is not specified, the computer searches for each occurrence, replaces the item, displays the line with the change and then asks you if you want this replacement. If you do, press ENTER; if you don't, press CONTINUE. If you wish to abort the CHANGE statement, press any other function key. When no further occurrences of the search string can be found a message "old not found" is displayed.
CHANGE is not allowed while a program is running, but it may be used when the program is paused. An error message will be displayed if a syntax error occurred during any CHANGE operation. When the line is corrected the CHANGE command continues. The CHANGE operation is aborted if a change exceeds the maximum allowable length of a program line or if a line number is altered.
If first-line doesn't exist, the line immediately after that line number is used. If a non-existent line label is specified, an error will be reported. If last-line is specified, searching will end with that line. If the line doesn't exist, the line immediately before that line number is used. If a non-existent line label is specified, an error will be reported. If last-line is not specified, searching will end with the last line in the program. This command can only be executed from the keyboard. It cannot be included in a program.