To find and replace a character string in the text in the active window, you must either:
Select the Replace option in the Help Editor's Edit menu.
Select the Replace option in the 4GL Editor's Edit menu.
This dialog box is used to find a character string in the active document (source or help text), starting at the cursor's current position, and replace it with another string.
If necessary, any sources in the 4GL Editor that contain blocks will be expanded in order to find any occurrences.
The search is performed in a loop: if either end of the document is reached, the search will continue in the same direction from the other end.
The search criteria will be retained for the options:
Find next and Find previous in the 4GL Editor's Edit menu.
Data entry
Find what
Character string to be found.
If a block of text was selected in the active document (source or help text) when the dialog box was opened, it will appear in this field.
Default setting: the most recent search character string.
The associated button lets you select a number of common elements found in regular expressions.
Expression
Descripion
Any character
Represents any single character (.)
Character range
Enters a range of possible characters ([])
Example: [A-Z]
Start of line
Locks the expression at the start of the line (^)
Valid only at the start of an expression.
End of line
Locks the expression at the end of the line ($)
Valid only at the end of an expression.
Stored subexpression
Subexpression that is stored for the Find and Replace function (())
Non-stored subexpression
Subexpression that is not stored ((?:))
Or
Logical OR (|)
Example: num_bin_2|num_bin_4
Zero, one or more occurrences
Repeats the expression zero, one or more times (*)
One or more occurrences
Repeats the expression at least once (+)
Quantifier
Repeats the expression in a quantified manner (x times, or from x to y times ({})
Example: {2,5} expression repeated between 2 and 5 times.
* equivalent to {0,}
+ equivalent to {1,}
Space
Represents spacing characters (\s)
ID character
Represents a character that can be part of an identifier (for Adelia, except for EBCDIC characters) (\w).
Decimal digit
Represents a digit (\d).
Equivalent to [0-9]
Replace with
Character string that is to replace the string entered in the Find what field.
By default, this is the last string used for the Replace function.
The associated button lets you select a number of common elements found in regular expressions.
Text found
Represents the text found during the search for a regular expression ($0).
Stored expression [1–9]
Text of the stored expression that corresponds to the selected number ($1-$9).
Note: If you are searching for a regular expression and want to include a "$" character in the replacement expression, you must double it ($$) in order to prevent the system from interpreting it as a stored expression.
Lists
Search in
List used to define the search scope.
The possible options are:
Active document
The search is performed on the current document.
All documents
The search is performed on all documents currently open in the editor.
Active block
The search is performed only on the current block (procedure, window, etc.). This option is only available if the current document is a structured source.
Selected text
The search is performed only on the current selection. The selection must be linear, i.e. it must not cover several blocks.
In this search mode, only the Replace all option is available.
Check boxes
Match whole word only
Checked
Only those occurrences which exactly match the character string will be found (the search will not return parts of words).
Unchecked
All occurrences containing the character string will be found.
Match case
Checked
The search will concern the character string as it has been typed in, with exactly the same use of upper and lower case.
Unchecked
The search will not distinguish between upper and lower case characters.
The search is performed on the text in the input string.
Buttons
Next
Used to resume the search after stopping at an occurrence of the string being sought, without replacing it.
Replace
Used to replace the detected occurrence with the character string entered in the Replace with field and continue the search.
Replace all
Used to find all the occurrences matching the criteria specified in the dialog box and automatically replace them with the string entered in the Replace with field.
Cancel
Closes the dialog box without running the search procedure.