Return to site

What are the types of ColdFusion loops?

ColdFusion loops are a specific type of code, that executes itself continuously for a number of time. In ColdFusion framework, <cfloop> is a tag which is used to define the loop and it has many different type of attributes.

There are many types of loops in a ColdFusion framework -

Index loop -

Index loop is used for the continuity of code for a number of times. It is used as

from-to syntax for defining the number of iterations. In index attribute, it is used to hold the counter value. It repeats itself until the value of “to” attribute is reached.

Conditional loop -

A conditional loop is a loop where a condition is put. While the condition is true, the iteration of code is continued. If the value of the variable is false, the loop will iterate itself. When the value of variable is true, the loops get terminated.

Query Loop -

A query loop is a loop, when the results of a ColdFusion query is needed to be executed for a number for periods.

File loop -

A file can be looped in the ColdFusion framework. In the “index” attribute, it is used to define the value of file name.

Hope you have liked this post ! Thanks for reading this post.


reference links -