Ariane logo ARIANE: A Visual Programming Interface

The Control Structure: While

Definition

A control structure While is an item which implements repetition control of a group of items. A repetition is done while a specified test expression is true.

The group of operators is described in a subgraph. This subgraph can be opened by double-clicking on the item.

The number of inputs, output, parameters are specified during the creation of the item. The number of parameter is at least 2, the ones used by the test expression.

Properties

while

Parameters

The parameters are named respectively:

  • $0
  • $1
  • $2
  • ...

Only the first two ones can be used in the test expression.

Repetition is related to the following instruction:

	while (test between $0 and $1) do
		execute the related subgraph.

Test Expression

The test is a boolean expression built with conjunction, disjunction, or negation connectors between constants, and the first two parameter values. More complex expression should be composed with the eval item.

Regular test expressions must be built with:

  • <
  • >
  • <=
  • >=
  • ==
  • !=

and the logical connectors:

  • & (AND)
  • | (OR)
  • ^ (XOR)
  • ! (NOT)

Example

($0>3.0) | ($1<=5)

Composition of the subgraph

The group of items to iterate is composed in a subgraph.

while subgraph

The input, mask, parameter and output slots of the control structure are accessible as connection slots in the subgraph:

  1. Input slots of the While item are located at the top left of the subgraph. These inputs are used for the first repetition.
  2. Intermediate input slots are located at the bottom left of the subgraph. Theses inputs are used for the next repetitions as re-entry inputs.
  3. Parameter slots are located at the top of the subgraph. These parameters are used for the first repetition. The other parameters contains the values defined in the property dialog of the While item.
  4. Intermediate parameter slots are located at the bottom of the subgraph. These parameters are used for the next repetitions as re-entry parameters.
  5. The mask slot is located at the top of the subgraph. The mask is the same for each repetition.
  6. The output slots are located at the bottom right of the subgraph. These outputs are the final outputs of the repetition.
  7. The result slot is located at the bottom of the subgraph. This value is the final result of the While item.

For example, the graph above corresponds to the following snippet of code:

datafile1 = datafile(inputslot$0)
while test(parameter$0,parameter$1, parameter$2)
do
  r1=perosion parameter$3 datafile1 datafile2
  r2=pvalueclassnumber datafile2
  parameter$0 = parameter$0
  parameter$1 = r2
  cp datafile2 datafile1
done
cp datafile2 outputslot$0
resultslot$0 = r2

Warning

To enable execution, each output as well as the final result must be linked before execution, even directly with inputs slots.

See also


Go to the reference manual