문제

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top