Example

Let us take an example to understand how the Do while activity works in automation. Take an integer variable. Starting with this variable, we shall generate all multiples of 2, less than 20.

Perform the following steps:

  1. Add a Sequence to the Designer panel.
  2. Add a Do while activity from the Activities panel.
  1. In the body section of the Do while activity, add an Assign activity.
  2. Now, select the Assign activity. Go to the Properties panel and create an integer variable y. Set its default value to 2.
  3. Set y+2 in the value section of the Assign activity to increment the result each time by 2 until the loop is executed.
  4. Add a Write line activity inside the Assign activity.
  5. In the text field of the Write line activity, type y.
  6. In the condition section, set the condition y<20. The loop will continue until the condition holds true:
  1. On clicking the Run button, the output displayed will be as follows:
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
13.58.60.192