ColdFusion CFscript - Perform while loop in script

cfscript - while loop in script

cfscriptWhile.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 while loop in cfscript</title>
</head>

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

<b>
<cfscript>
 counter = 1;
 while(counter LTE 5){
  WriteOutput("Counter Now: #counter# <br />") ;
  counter = counter+1;
 }
</cfscript>
</b>
</body>
</html>






More ColdFusion examples