Nasal Loops: Difference between revisions

Jump to navigation Jump to search
m
→‎for, while, foreach, and forindex loops: not sure how to explain this better to non-programmers ? - P. ??
m (Syntax highlight and remove (extraneous) heading)
m (→‎for, while, foreach, and forindex loops: not sure how to explain this better to non-programmers ? - P. ??)
Line 5: Line 5:
== for, while, foreach, and forindex loops ==
== for, while, foreach, and forindex loops ==
Nasal's looping constructs are mostly C-like:
Nasal's looping constructs are mostly C-like:
<syntaxhighlight lang="php">
for( preloop_initialization; # will be run prior to the first invocation of the loop, usually to initialize a loop counter
    condition_during_loop;  # will be run prior to each iteration, usually to check the loop counter  and cancel the loop if false
    post_iteration_expression # will be run after each iteration, usually to increment a loop counter
  )
{
   
    # loop body
}
</syntaxhighlight>


<syntaxhighlight lang="php">
<syntaxhighlight lang="php">

Navigation menu