For
The following table provides information regarding the 'For' SFCodeBlock.
For SFCodeBlock
| Category | Logic |
|---|---|
| Description | The 'For' loop executes the inner stacked SFCodeBlocks for a well-defined number of times. The number of iterations depends on the parameter type. Numerical Literal The current analytic continues the execution and the new analyticis executed in parallel. Additional SFCodeBlocks are allowed to synchronize with the spawned analytic and access its data. AnalyticVariable The current analytic stops its execution until the new analytic completes its execution. Analytics executed in sync behave like functions, but run in a fully independent execution context. Variable or Expression While iterating for an element variable value or an expression, the number of iterations may vary from element to element according to the content of the variable or of the expression. |
| Input | CurrentAF Element |
| Parameters | None |
| Pattern Support | Limited |
| Returns | None |
| Configuration | You are required to configure the loop. To configure the loop: 1. Click on the empty label. For SFCodeBlock 2. Enter your configuration values in the configuration panel. |
Note
The 'For'code block does not support a dynamic condition (i.e.all parameters). From, to and Step are evaluated at the first iteration only.
Note
The 'For' cycle is executed in parallel, for each element of the working space.
tip
Use integer numbers as much as possible. Although decimal numbers are supported, they can cause potential accuracy issues.
For Configuration Panel
The following table describes the configuration options.
| Item | Required | Description |
|---|---|---|
| Enumerator Name | X | Name of the enumerator variable used to control the iterations. It must be a valid identifier as specified in the SFHubEnumerator section of the "SigmafineHub Expressions Guide". |
| From | X | Starting value of the enumerator (numeric). |
| To | X | Ending value of the enumerator. The loop terminates when the enumerator reaches the ending value. |
| Step | X | Incremental step applied to the enumerator at the end of each cycle. |
note
The enumerator name cannot be a numeric literal and cannot start with $ or _ character.
important
Configuring Step = 0 generates an infinite iteration loop
Example: Use of the For loop
