Core.Actions.Loop.WhileLoop

From emotive
Revision as of 12:21, 4 February 2016 by Hb (talk | contribs) (→‎See also)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Classification

Name WhileLoop
Short Description Loop that is iterated until the condition evaluates to false.
Class Action
Extension OTX Core library
Group Core related actions
Exceptions -
Checker Rules -
Standard Compliant Yes

OTL Syntax

// While (do)
while (BooleanTerm) : WhileLoopName
{
   ...
}

//Do while
do
{
   ...
} while (BooleanTerm) : WhileLoopName

Description

The OTX (do) WhileLoop activity contains a sequence of activities that are executed repeatedly until the condition evaluates to false. The expression for the condition is either before (while) or calculated according to (do while) the loop and tested.

Icons Note.png Please keep in mind that Do While at least once iterate loop!

The loop can be exited about the activities of break, return, or throw. The continue activity stops the current iteration and continues with the next iteration, without having to leave the loop.

Properties

Name Data Type Class Default Cardinality Description
IsPostTested Boolean Value - [0..1] The condition is tested before the execution of the loop (while false) or afterwards (true, do-while)
Test Boolean Term - [1] Continue the loop condition expression

OTL Examples

Integer Integer1;

while (Integer1 < 10) : WhileLoop1
{
   Integer1 = (Integer1 + 1);
}

do
{
   Integer1 = (Integer1 + 1);
} while (Integer1 < 10) : WhileLoop2

See also

ForLoop
ForEachLoop