manpagez: man pages & more
info gmsh
Home | html | info | man
[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.6 Loops and conditionals

Loops and conditionals are defined as follows, and can be imbricated:

For ( expression : expression )

Iterates from the value of the first expression to the value of the second expression, with a unit incrementation step. At each iteration, the commands comprised between `For ( expression : expression )' and the matching EndFor are executed.

For ( expression : expression : expression )

Iterates from the value of the first expression to the value of the second expression, with a positive or negative incrementation step equal to the third expression. At each iteration, the commands comprised between `For ( expression : expression : expression )' and the matching EndFor are executed.

For string In { expression : expression }

Iterates from the value of the first expression to the value of the second expression, with a unit incrementation step. At each iteration, the value of the iterate is affected to an expression named string, and the commands comprised between `For string In { expression : expression }' and the matching EndFor are executed.

For string In { expression : expression : expression }

Iterates from the value of the first expression to the value of the second expression, with a positive or negative incrementation step equal to the third expression. At each iteration, the value of the iterate is affected to an expression named string, and the commands comprised between `For string In { expression : expression : expression }' and the matching EndFor are executed.

EndFor

Ends a matching For command.

If ( expression )

The body enclosed between `If ( expression )' and the matching Endif is evaluated if expression is non-zero.

EndIf

Ends a matching If command.

See t5.geo, for an example of For and If commands. Gmsh does not provide any Else (or similar) command at the time of this writing.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]
© manpagez.com 2000-2024
Individual documents may contain additional copyright information.