
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
168
|
Chapter 8: Loop Statements
Update
The statements that modify the variables used in the test expression before a
subsequent test. A typical update statement increments or decrements the loop’s
counter.
Iteration
One complete execution of the test expression and statements in the loop body
(sometimes referred to as one loop or one pass).
Nesting or nested loop
A loop that contains another loop, allowing you to iterate through some sort of
two-dimensional data. For example, you might loop through each row in a col-
umn for all the columns in a table. The outer or top-level loop would progress
through the columns, and the inner loop would progress through the rows in
each column.
Iterator or index variable
A variable whose value increases or decreases with each iteration of a loop, usu-
ally used to count or sequence through some data. Loop iterators are often called
counters. Iterators are conventionally named
i, j, and k, or sometimes x, y, and
z. In a series of nested loops, i is usually the iterator of the top-level loop, j is the
iterator of the first nested loop,
k is the iterator of the second nested loop, and so
on. You can use any variable name you like for clarity. For example, you can use
charNum as the variable name to remind yourself that it indicates the current char-
acter in ...