Iterating (loops)

From Progzoo
Revision as of 18:18, 26 October 2008 by Cs66 (Talk | contribs) (New page: {{Iterating}} You can "iterate" to loop over a set of values. :for ::The for loop is often used to loop over numbers - 0,1,2,3,4,5,6,7,8,9 for example :foreach ::You use foreach loops to r...)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Iterating (loops)
for
foreach
while

You can "iterate" to loop over a set of values.

for
The for loop is often used to loop over numbers - 0,1,2,3,4,5,6,7,8,9 for example
foreach
You use foreach loops to run over the values in an array or a list
while
You can use a while loop to keep looping until some condition is achieved