Topic: DMD0288

Search and Replace


Replace is used to replace or swap one program element with another element, or replace or swap a range of program elements with another range of elements. The search and replace can operate in the current code-block, or a separate code-block, within in a section of a code-block or the entire code-block. The search and replace operation can perform one operation at a time, or can be used to build a table of operations that can be performed in bulk.

 

Note: Search and Replace will not work in code-blocks that are locked. Refer to the help topic on code-block protection for more information.

 

The search and replace dialog can be invoked by selecting the Search-> Replace menu selection or pressing Ctrl + R.

 

 

Replace / Swap Conditions - define the search options and the replace actions

 

Replace - select this option to replace all occurrences of the Search Element with the specified replacement element, for example replace X1 with X2

 

Swap - select this option to swap all occurrences of the Search Element with the specified replacement element, for example swap X1 with X2

 

With - enter the program element to replace or swap with the Search Element (Press F9 to invoke the Element Browser or the down arrow for auto-complete)

 

Match Exactly - check this box to force the search operation to match the case of the Search Element

 

Number of Elements - specifies the number of sequential elements to include in the search and replace operation. As the number of elements increases the Through' fields will be automatically filled in to serve as visual confirmation of which program elements will be affected by the search and replace operation.

 

Add to List - adds the current search and replace operation to the Replace / Swap List

 

Update in List - if this button is enabled, the programmer is editing a search and replace entry that is already in the Replace / Swap List, clicking this button will update that entry with the current search and replace operation

 


Documentation Group - designates what action to take when dealing with program elements that have element documentation (Nickname, Extra Info, Description).

 

Note: both the Replace/Swap element and With element MUST be documentable to enable the Documentation group.

 

  • Move - the Element Documentation is moved from the source elements to the destination elements, the element documentation is removed from the source elements to eliminate duplicate element documentation

     

  • Copy - Element Documentation is copied from the source elements to the destination elements.This option is only available when the Replace operation has been selected to eliminate the duplicate element documentation.
     

  • Leave - Element Documentation is left with the source elements.

 


Where to Replace - designates the code-blocks where the search and replace operations will be performed

 

  • All Control Logic - select this option to include all of the code-blocks in the current project

     

  • A Specific Code-Block - select this option to perform the search and replace operation only on the specified code-block, click the down arrow to display a list of the Tasks and Programs in the current Project.

     

    • Entire Code-Block - select this option to perform the search and replace operation over the entire code-block

       

    • Rung - select this option to perform the search and replace operation only on the specified range of rungs within the code-block. Enter a range of addresses (will be converted to rung boundaries) that will be used.

 


Replace / Swap List - when either Add to List or Update in List is clicked in the Replace / Swap Conditions group to perform multiple search and replace instructions, this list will be displayed. This list contains the individual search and replace operations that will be all performed when the Replace! button is clicked.

Selecting an object from the table will place the object in the object section to be edited.

 

Delete From List will delete the highlighted entry from the replacement list.

 


Click the Replace! button to perform the single search and replace operation (or the bulk search and replace operation in the Replace / Swap List)

 

Click Cancel to exit the dialog without performing the search and replace operation.

 


See Also: