Working with Variable Search Process
Process Purpose
The "Variable Search" process is used to perform a search for a string inside a variable and retrieve its position.
Check the provided "Variable Search" 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" process.
If any subsequent edition is required, double-click the process to open its properties window and enter the necessary modifications.
Source Variable |
|
Click |
|
From Position |
Define the starting position for the search within the source string. |
To Position |
Define the end position for the search within the source string. If set to zero, the search is extended to the final string position/character. |
Search |
|
Data |
Define the string to search. Enter it directly OR click |
Occurrence |
Define the search criterion: First - Only considers the first time the string is found. Last - Only considers the last time the string is found. 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. |
Results |
|
Result Start Position |
Click |
Result Next |
If required, click |
Result Number of Data Found |
Click |
If Not Found Go to |
|
Define a target location if the searched string is not found in the source string. Either use a destination from the drop-down or the
|
Detail of a window:
"S:Menu" is a screen included in the same program as the process.
"R:Routine_1" is a routine included in the same program as the process.
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.
If you want to use a label as a target destination, you can use the "Auto-Label" mechanism. This alternative to the "Set Label" process allows you to create a label in the properties window of a process - specifically, in the fields used to define target destinations (ex: the "If Error..." type fields). See To Automatically Create a Label.
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 String length: 40 characters
|