ColdFusion CFscript - Do while loop in script

cfscript - do while loop in script

cfscriptDoWhile.cfm


<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>cfscript tag: How to use do while loop in cfscript</title>
</head>

<body>
<h2 style="color:DodgerBlue; font-style:italic">cfscript example: do while loop</h2>
<hr width="350" align="left" color="PaleVioletRed" />

<h4 style="color:SeaGreen;">
 <cfscript>
        counter = 1;
        do{
        
            WriteOutput("Current Position: #counter# <br />") ;
            counter = counter+1;
        }
        while(counter LTE 6);
    </cfscript>
</h4>

</body>
</html>






More ColdFusion examples