Index Loops


<CFLOOP INDEX="parameter_name"
    FROM="beginning_value"
    TO="ending_value"
    STEP="increment">
    ...
    HTML or CFML code to execute
     ...
</CFLOOP>

An index loop repeats for a number of times determined by a range of numeric values. Index loops are commonly known as FOR loops, as in "loop FOR this range of values."

INDEX

Required. Defines the parameter that is the index value. The index value will be set to the FROM value and then incremented by 1 (or the STEP value) until it equals the TO value.

FROM

Required. The beginning value of the index.

TO

Required. The ending value of the index.

STEP

Optional. Default is 1. Sets the value by which the loop INDEX value is incremented each time the loop is processed.