endloop

Completes a loop construct.

Syntax

endloop

Input

N/A

Example

Example 1
Template:
{for(a=0; a<=PI/2;
    a += PI/12)}
   Angle: {a, %6.4¦}
   Sin: {sin(a), %6.4¦}
{endloop}
Output:
Angle: 0.0000  Sin: 0.0000
Angle: 0.2617  Sin: 0.2588
Angle: 0.5235  Sin: 0.5000
Angle: 0.7853  Sin: 0.7071
Angle: 1.0471  Sin: 0.8660
Angle: 1.3089  Sin: 0.9659
Angle: 1.5707  Sin: 1.0000
Example 2
Template:
{num = 0}
{gmat = {10, 20, 30, 40}}
{foreach(elem=gmat); num++}
   Element {num}: {elem}
{endloop}
Output:
Element 1: 10
Element 2: 20
Element 3: 30
Element 4: 40

Comments

Every loop construct in a template must end with an endloop statement. Loop constructs include for, foreach, and while. When a loop terminates, the statement following the endloop statement is executed.