Hello,

I'm trying to modify an index variable during a cfloop and it isn't
working as i would expect it to work. Code:

<cfloop index="x" from="1" to="50">
  <cfoutput>#x# </cfoutput>
  <cfif x EQ 5>
    <cfset x = 20/>
  </cfif>
</cfloop>


Output:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50

Expected Output:

1 2 3 4 5 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
41 42 43 44 45 46 47 48 49 50

I don't know if it's a bug or a feature, but could someone please
enlighten me on this issue?

If it's really a feature. How could i skip more than one loop iteration
and/or change to other different index position?

Thanks a lot.
Regards.

-- 
Open BlueDragon Public Mailing List
 http://www.openbluedragon.org/   http://twitter.com/OpenBlueDragon
 online manual: http://www.openbluedragon.org/manual/

 mailing list - http://groups.google.com/group/openbd?hl=en

Reply via email to