Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

<CFSET i=0> <CFLOOP CONDITION="# 2

Status
Not open for further replies.

ChiefJoseph

Programmer
Feb 16, 2001
44
0
0
US
Hey guys,

Heres the deal, I want to dynamically populate an array then output it later. Now my C++ brain tells me to do it this way.



<CFSET days=ArrayNew(1)>
This is where i populate the array
<CFSET n=0>
<CFLOOP CONDITION=&quot;n LT endday&quot;>
<CFSET days[n]=&quot;n&quot;> THIS IS WHERE I GET THE ERROR
<CFSET n=n+1>
</CFLOOP>

This is the output

<CFSET n=0>
<CFLOOP CONDITION=&quot;#n# LT 7&quot;>
<td width='#twidth#' bgcolor='#weekbg#' align='center' valign='middle'><font face='#weekfam#' size=#weeksize# color=#weekcol#><b>
#days[&quot;#n#&quot;]#
</b></font></td>
<CFSET n=n + 1>
</CFLOOP>

I searched the archive questions and didn't I couldn't find anything. Any help would be helpfull.
 
you are initializing variable &quot;n&quot; with zero. But as per my knowledge array items starts with 1. Try this one
<cfset n=1>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top