Top
PowerCOBOL V11.0 User's Guide
FUJITSU Software

5.5.4 Replacing Text

The Project Manager Replace (All) function searches for the specified string throughout all event and COBOL procedures belonging to the selected part of the project tree, and replaces it with the replacement string. You can replace all occurrences or have the Replace function step you through each occurrence of the specified string.

The Replace dialog is shown and explained below:

Figure 5.16 The Replace dialog window

The Replace dialog is made up of three panes: the Control pane, the Target pane and the Result pane. The contents of these panes are described below.

Control Pane

The control pane provides the functions for specifying the type and range of the Replace and for controlling the Replace operation. You specify the replace range and method of handling the results before you start the Replace operation.

Type of Replace:

Currently there is only one type of replace supported - replacing text - so the selection is disabled. This will be expanded in future releases.

Replace Range:

The drop down list shows the name of the project being searched. This field is disabled.

Includes children of the selected object:

Check this box to have Replace search objects that are on branches of the selected object in the project tree.

Excludes the selected object:

Select this box if you only want to search objects that are on branches of the selected object and not the selected object. The check box is disabled if "Includes children of the selected object" is not selected.

Display results - One by one:

Select this button if you want Replace to stop each time it makes a find.

Display results - All occurrences:

Select this button if you want Replace to search through the whole range, replacing all matching strings, and displaying results in the Result pane.

Replace Button:

The Replace button initiates the Replace operation, locating the first string that matches the "Find what" string. The Replace operation continues until all matching strings have been found or until the Cancel button is pushed.

Close Button:

The Close button closes the Replace dialog. It is disabled during a Replace operation.

Replace and Next Button:

The Replace and Next button is enabled when a Replace one-by-one operation starts. It replaces the currently located string with the "Replace what" string, registers the result of the Replace in the Result pane and searches for the next occurrence of the "Find what" string.

Skip Button:

The Skip button is enabled when a Replace one-by-one operation starts. It does NOT replace the currently located string, does NOT register anything in the Result pane, and searches for the next occurrence of the "Find what" string.

Replace All Button:

The Replace All button is enabled when a Replace one-by-one operation starts. It causes the Replace operation to search for all remaining occurrences of the "Find what" string, replace those strings with the "Replace what" string, and display the results in the Result pane.

Cancel Button:

The Cancel button is enabled when a Replace one-by-one operation starts. It terminates the Replace operation so that you can start a new Replace operation or close the Replace dialog.

Target Pane

Find what:

Specify the string for which Replace should search in the "Find what" combo box. You can either select a string from the drop down list of strings used in previous searches or enter a new string.

Replace what:

Specify the string that Replace should use to replace "Find what" strings. You can either select a string from the drop down list of strings used in previous replaces or enter a new string.

Match case:

Check the "Match case" box if you only want to find strings that exactly match the case of the characters in the "Find what" string.

Result Pane

The Result pane lists the locations where strings have been replaced. You can double-click on the position of a result item to see the changed text in the PowerCOBOL Editor or use the pop-up menu described below.

The results are listed with:

Position:

The location of the replaced string in the project. Includes starting and ending row and column numbers.

Text:

Displays the contents of the line containing the "Find what" string, before the string is replaced.

Results Pane Pop-up Menu

If you right click on the position of a result item Replace displays a pop-up menu with the following functions:

Edit:

Displays the procedure containing the selected line in the PowerCOBOL Editor with the location of the original string highlighted.

Cut:

Copies the characters that now occupy the location of the original string to the clipboard and deletes those characters from the selected location in the procedure.

Copy:

Copies the characters that now occupy the location of the original string to the clipboard.

Delete:

Deletes the characters that now occupy the location of the original string from the selected location in the procedure.

Note

These functions only work if you are using the PowerCOBOL Editor.

Caution

Updates to procedures after a Replace operation has been executed may invalidate the Replace result positions so be sure you have the correct text selected before using these operations.