User:LABoyd2/Conditional and Iterator Functions from manual 151002

For Loop
Iterate over the values in a vector or range.

Vector version: for (variable= )  - is assigned to each successive value in the vector Range version: for (variable= ) 

Nested loops : for ( variable1 =, variable2 = )  for loops can be nested, just as in normal programs. A shorthand is that both iterations can be given in the same for statement

Nested loop example

Intersection For Loop
Iterate over the values in a vector or range and take an intersection of the contents.

Note:  is a work around because of an issue that you cannot get the expected results using a combination of the standard   and   statements. The reason is that  does an implicit   of the contents.

Parameters


 * &lt;loop variable name&gt; : Name of the variable to use within the for loop.

If Statement
Conditionally evaluate a sub-tree.

Parameters


 * The boolean expression that should be used as condition

NOTE:

Do not confuse the assignment operator '=' with the equal operator '==' NOTE:

Assignment is not allowed within either branch of an if statement. Consider using the ternary operator 'condition ? consequent: alternative'.

Usage example:

Assign Statement
Set variables to a new value for a sub-tree.

Parameters


 * The variables that should be (re-)assigned

Usage example:

Update:

Starting with this version, assign has been deprecated as it is no longer needed; variables can be assigned anywhere.