CBA never equals 4 (1,3,5,7...) so the CFEXIT tag is never executed.  This 
means that the inner loop always executes fully.  An indexed loop will 
execute until its index value is >= to the TO value.  In this case TIMEX 
never equals exactly 30 (2,12,22...), so goes to 32 before the inner loop 
is exited.

----- Original Message ----- 
From: "Asim Manzur" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Monday, November 01, 2004 8:17 AM
Subject: Can someone Explain this code


> The following code display 32.
>
> If you run the code the value in the var on the last trip of the loop 
> was 22
>
> after it finish the loop how come the value changes to 32. Can 
> understnad that. can someone explain it to me please.
>
> <CFLOOP INDEX="CBA" FROM="1" TO="15" STEP="2">
> <cfoutput>
> This is an outer Loop ang CBA Value is #CBA#<BR>
>  <CFLOOP INDEX="TIMEX" FROM="2" TO="30" STEP="10">
>  This is an inner Loop ang TIMEX Value is #TIMEX#<BR>
>    <CFIF CBA EQ 4>
>       <CFEXIT METHOD="LOOP">
>    </CFIF>
>  </CFLOOP>
> </cfoutput>
> </CFLOOP>
>
>
> <cfoutput>#timex#</cfoutput>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Sams Teach Yourself Regular Expressions in 10 Minutes  by Ben Forta 
http://www.houseoffusion.com/banners/view.cfm?bannerid=40

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:183089
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to