Difference between revisions of "Control flow: Repeat actions"

m
m
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
* '''''Fixed number'''''
+
<span style="color: #4527a0; font-size: 24px;">
 +
'''Fixed number '''</span>
 
<pre style="background-color: #ACC8E5; color: #112A46; border-radius: 10px; padding: 10px;">
 
<pre style="background-color: #ACC8E5; color: #112A46; border-radius: 10px; padding: 10px;">
 
Allows one or more actions to be repeated a fixed number of times.
 
Allows one or more actions to be repeated a fixed number of times.
Line 6: Line 7:
  
 
It is ideal for situations where a fixed number of iterations is required, ensuring precision and control in the execution of the macro.
 
It is ideal for situations where a fixed number of iterations is required, ensuring precision and control in the execution of the macro.
</pre>
+
</pre><br/>
* ''''' While 'condition' '''''
+
<span style="color: #4527a0; font-size: 24px;">
 +
'''While 'condition'''</span>
 
<pre style="background-color: #ACC8E5; color: #112A46; border-radius: 10px; padding: 10px;">
 
<pre style="background-color: #ACC8E5; color: #112A46; border-radius: 10px; padding: 10px;">
 
Before executing any instruction inside the loop, the condition is first evaluated.
 
Before executing any instruction inside the loop, the condition is first evaluated.
Line 16: Line 18:
  
 
If the condition is false from the start, the code inside the loop is not executed at all.
 
If the condition is false from the start, the code inside the loop is not executed at all.
</pre>
+
</pre><br/>
* ''''' Do once and repeat while 'condition' '''''
+
<span style="color: #4527a0; font-size: 24px;">
 +
'''Do once and repeat while 'condition'''</span>
 
<pre style="background-color: #ACC8E5; color: #112A46; border-radius: 10px; padding: 10px;">
 
<pre style="background-color: #ACC8E5; color: #112A46; border-radius: 10px; padding: 10px;">
 
In this type of loop, the actions inside the loop are executed once before the condition is evaluated for the first time.
 
In this type of loop, the actions inside the loop are executed once before the condition is evaluated for the first time.
Line 26: Line 29:
  
 
The distinguishing feature here is that the code inside the loop is guaranteed to be executed at least once, regardless of the initial condition.
 
The distinguishing feature here is that the code inside the loop is guaranteed to be executed at least once, regardless of the initial condition.
 +
</pre><br/>
 +
<span style="color: #4527a0; font-size: 24px;">
 +
'''Endless Lop (until break)'''</span><br/>
 +
 +
<pre style="background-color: #ACC8E5; color: #112A46; border-radius: 10px; padding: 10px;">
 +
This is a type of loop that runs indefinitely until a 'Break From Loop' action is encountered.
 +
 +
This type of loop is ideal for situations where you need to constantly repeat the actions within the macro.
 +
</pre><br/>
 +
<pre style="background-color: #FFFF99; color: #112A46; border-radius: 10px; padding: 10px;">
 +
The loop will continue until a 'Break From Loop' action is explicitly triggered to stop its execution.
 +
 +
It is recommended to use this functionality in combination with well-defined conditions that determine when the 'Break From Loop' action must be executed to end the loop.
 +
 +
In addition, consider including 'Wait Before Next Action' actions within the loop.
 
</pre>
 
</pre>

Latest revision as of 19:10, 16 February 2024

Fixed number

Allows one or more actions to be repeated a fixed number of times.

Selecting this option allows the user to specify exactly how many times the actions should be performed within the loop.

It is ideal for situations where a fixed number of iterations is required, ensuring precision and control in the execution of the macro.


While 'condition

Before executing any instruction inside the loop, the condition is first evaluated.

If the condition is true, the code inside the loop is executed.

This process of evaluating the condition and executing the code is repeated until the condition becomes false.

If the condition is false from the start, the code inside the loop is not executed at all.


Do once and repeat while 'condition

In this type of loop, the actions inside the loop are executed once before the condition is evaluated for the first time.

After this first execution, the condition is evaluated.

If the condition is true, the loop repeats. If it is false, the loop terminates.

The distinguishing feature here is that the code inside the loop is guaranteed to be executed at least once, regardless of the initial condition.


Endless Lop (until break)

This is a type of loop that runs indefinitely until a 'Break From Loop' action is encountered.

This type of loop is ideal for situations where you need to constantly repeat the actions within the macro.


The loop will continue until a 'Break From Loop' action is explicitly triggered to stop its execution.

It is recommended to use this functionality in combination with well-defined conditions that determine when the 'Break From Loop' action must be executed to end the loop.

In addition, consider including 'Wait Before Next Action' actions within the loop.