iRobo.Activity.While
While activity helps to execute a repeated process.
It is used either to go through an array of elements, or execute a specific activity multiple times.
Note: While loop executes a statement as long as a given condition is True. The condition is evaluated before the Body of the loop is executed. |
Properties
- Condition - Get Condition value.
- DisplayName - Activity header name.
Example on Using While Activity
To better understand While Activity, let's build an automated process that counts a Counter value with a condition, and displays its value in a MessageBox with the counted number.
- Open iRobo Studio, and then open a new Workflow.
- Drag While Activity to the Sequence.
- Create Counter Variable in Variable Table with Integer Data Type.
- Specify Counter Variable Scope in Variable Table as: "Sequence".
- In While Condition, add Counter <5.
- Drag Assign Activity to the While Sequence.
- Assign Counter Variable to Assign Activity, Counter = Counter +1 ,as shown in the image below.
- Drag MessageBox Activity to the While Sequence as shown in the image below.
- Click Save button from iRobo Studio Menu to save Workflow.
- Click Play button to start the automated process.
Created with the Personal Edition of HelpNDoc: Generate Kindle eBooks with ease