September 10th, 2013, 10:16 AM
How to get specific value of CFLOOP?
For example, i have the code below.
<cfloop index = i from = 1 to = 5>
I want to set the value of 1 to First_Variable or I want to set the 5th value to Fifth_Value. How will I do this in CF?
September 10th, 2013, 02:21 PM
If I follow what you're asking, something like:
<cfloop index="i" from=1 to=5>
<cfif i eq 1>
<cfset first_variable = i />
That said, given your example I can't really imagine why you'd want to do it this way, but I assume what you're actually trying to do is more complex than this.