[Home]
HomePage RecentChanges Frequently Asked Questions

repeat

A '''repeat loop''' is a [conditional loop] that repeatedly executes a block of instructions whilst the condition is true. The do statement is used together with an [while] syntactical cocomponent to produce a repeat loop:

BEGIN { attempts = 1 do { print "Knock! Knock!" attempts = attempts + 1 } while( attempts <= 10) }

_The block of code within a repeat loop will always run at least once_

Note than unlike [while] loops, with a repeat loop, the [condition] is evaluated after the [block] of code within the loop. This means that the [block] of code within a repeat loop will always run at least once.


Edit this page View other revisions Administration
Last edited 2011年08月14日 16:00 UTC by markhobley

Powered by sdf Creative Commons License <pierre.gaston+awk@gmail.com>

Awk Wiki by #awk is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.

AltStyle によって変換されたページ (->オリジナル) /