Working with Variable Search Process

Navigation:  How to Work with Processes > Working with the Variable Processes Group >

Working with Variable Search Process

Previous pageReturn to chapter overviewNext page

 

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 to select the variable where the search will be performed. See Variable Usage.

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 and select a variable with that string.

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 and define a variable to store the position of the first occurrence of the string being searched within the defined search scope ("From" and "To" positions).

See To Select/Create a Variable.

Result Next

If required, click and define a variable to store the position of the searched string's last character + 1 position within the defined search scope ("From" and "To" positions).

Result Number of Data Found

Click to define a variable that will store the number of times the searched string was found between the intended occurrence and the start position of the search scope (occurrences are counted right to left).

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 list. See Detail of a window below.

 

When defining a screen as a target destination (ex: via a “Go to” process), you CANNOT use variables to specify the name of that target screen. You must select the intended screen from the available drop-down/list.

 

 

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.

 

 

 

Click Here for Examples of "Variable Search" Results