I've run into this issue a few times in the past. Whereas cfscript code wasnt executing as expected, but when converted to tags it works properly. Here is my latest issue. I figured I'd post it here to see if anyone knew why its not working.

the iterations array has a length of 2.

<cfscript>
for(i=1;i LTE arrayLen(iterations); i = i + 1)
{
   thisIteration = getIteration(iterations[i]);
   if(this.error)return thisRoute;
   arrayAppend(thisRoute.iterations, thisIteration);
}
</cfscript>

The above script creates a new iteration, but only with 1 element.

<cfloop from="1" to="#arrayLen(iterations)#" index="i">
  <cfset thisIteration = getIteration(iterations[i])>
  <cfif this.error><cfreturn thisRoute></cfif>
  <cfset arrayAppend(thisRoute.iterations, thisIteration)>
</cfloop>

The tag based approach, which is an exact conversion creates a new array with 2 elements as expected.

So anyone have any idea why the tag based approach works but the script version doesn't?

[Adam Wayne Lehman]

------------------------------------------------------------
If you don't fake the funk, the funk will fake you.
------------------------------------------------------------
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to