Page 1 of 1

For loops in NMODL

Posted: Mon Oct 05, 2009 5:15 am
by Bill Connelly
Do for loops exist in NMODL? Or do I have to break into a VERBATIM block? If so, is there any other conditional loop in NMODL? Are VERBATIM blocks always un-threadsafe?

Re: For loops in NMODL

Posted: Mon Oct 05, 2009 2:54 pm
by ted
NMODL offers two types of conditional loops: FROM loops (basically "for loops") and WHILE loops. Examples:

Code: Select all

FROM <index> = <expression> TO <expression> [BY <positive increment>]
{
<statement list>
}

WHILE [<unary_logical_operator>] <expression>
        [<binary_logical_operator> <expression>]
{
<statement list>
}