I would like to output two numbers consecutively:
- Number one
- Number two
Below is the basic code:
<cfloop index="x" from="2" to="#ListLen(stringOf200Numbers)#" >
<cfset x2 = x>
<cfoutput>
<h2>#x#</h2>
<h2>#x2#</h2>
</br>
</cfoutput>
</cfloop>
I have tried many different angles.. would love some expert assistance...
Well the next index in the loop is going to be... x+1
, isn't it? So the first entry in stringOf200Numbers
is going to be listGetAt(stringOf200Numbers, x)
, and the second one is going to be listGetAt(stringOf200Numbers, x+1)
. Be careful at the end of the loop though... there will not be an x+1 entry for the last list position.