Working with Variable Search/Replace Process
Process Purpose
The "Variable Search/Replace" process is used to perform a search for a string inside a variable and replace that string with another one.
Check the provided "Variable Search/Replace" examples at the end of the topic.
When you add a process, you are required to define its settings. This occurs in the process's properties window which is displayed automatically after having added the "Variable Search/Replace" process.
If any subsequent edition is required, double-click the process to open its properties window and enter the necessary modifications.
Fill in the following options:
Source Variable |
|
Click to select the variable where the search will be performed. See Variable Usage. |
|
From Position |
Define the start position for the search within the source string (the search scope for the string to replace). |
To Position |
Define the end position for the search within the source string (the search scope for the string to replace). If set to zero, the search is extended to the final string position/character. |
Search |
|
Data |
Define the string to search and replace. Enter it directly or click and select a variable with that string. |
Occurrence |
Define the search/replacement criterion: All - Considers every occurrence within the search scope. First - Only considers the first time the string is found within the search scope. Last - Only considers the last time the string is found within the search scope. No - Define the number of occurrences between first and last position to be considered for the search. Ex: "3" means the Variable Search process will look for the 3rd time the character(s) being searched is(are) found in the source string. Check the "No." option. This opens a box where you can insert the intended number of occurrences. |
Replace By |
|
Define the string that will replace the searched string. Either enter it or click and select a variable with that value. |
|
Results |
|
Result Variable |
Click to select the variable that will receive the resulting string with the string replacement. See To Select/Create a Variable. |
Number of Replacement (Optional) |
As an option, click to select a variable to receive the number of times the defined string was replaced. This option applies mostly to the "All" search/replacement criterion (all the other criteria retrieve a "1" value). |
If required, click (on the upper right corner) and enter info about this process in the resulting text box. These notes will be displayed in the corresponding "Actions" tab or "Process" window (in the "Notes" field) and in the "Developer Report".
After filling in the required options, click to conclude or to abort the operation.
The added process is displayed in the corresponding "Actions" tab or "Process" window.
Use the right-click in MCL-Designer's input boxes to access some related options as well as the general "Cut", "Copy"; "Paste"; "Search" actions (active/inactive according to the current context).
Ex: If you right-click the "Variable" input box (included in a "Conversion's" properties window), you are provided with general editing/search actions and other more specific options such as "Variable Select" (see "Variable Select"); "Variable Insert" (see "Variable Insert"); "Insert Special Character" (see To Insert Special Characters into a Control's Text Input Field) and "Localization Select" (see Localization List).
If you right-click another input box, it may provide other possibilities.
String to be searched: 12;34;56;12;AB;34;12;534;12;13;14;34;456
|