CF 8.0 cfscript variable
Pls check if this is a bug cos it seemed like the cfscript and main cfoutput shared the same variable:
Result : 5
Expeced Result: 1
<cfscript>
function
valid4D(str)
{
if (len(str) neq 4)
return false;
if (Ucase(str) eq "XXXX")
return false;
for(i = 1; i lte 4; i = i + 1){
c =
Mid(str, i, 1);
if (Not Find(c, "0123456789xX"))
return false;
}
return true;
}
</cfscript>
<cfloop
from="1" to="1" index="i">
<cfif not #valid4D("5555")#>
<cfset err= 1>
</cfif>
<cfoutput>#i#</cfoutput>
</cfloop>