I just noticed something strange with CFLoop Index. Looks like Lucee’s implementation of cfloop isn’t able to handle countdown/decreasing indexes.
Something like the below:
<cfloop index="i" from="10" to="1">
<cfoutput>#i#<br></cfoutput>
</cfloop>
This will produce nothing on Lucee (basically Lucee doesn’t loop through it) while Coldfusion can handle both incremental/decremental index loops.
Of course, we can use a workaround like:
<cfset MyNum = 10>
<cfloop index="i" from="1" to="10">
<cfoutput>#Evaluate(MyNum - DecrementValue(i))#<br></cfoutput>
</cfloop>
However, just thought I’d raise this here regarding this behaviour on Lucee. I’m using the latest stable version of Lucee.
Lucee: 5.3.8.201
Tomcat:8.5.11
Java: 1.8.0_121
Thanks.
Charles Tang