Since your error was here: <cfset returnstruct.cleanedstring=listappend(returnstruct.cleanedstring,x[5])>
I'd check this line <cfset x=listtoarray(descriptlistArray[x])> are you _sure_ descriptlistArray[x] is always a list with N items? Can you show us your code as it is now? ======================================================================== === Raymond Camden, ColdFusion Jedi Master for Mindseye, Inc (www.mindseye.com) Member of Team Macromedia (http://www.macromedia.com/go/teammacromedia) Email : [EMAIL PROTECTED] Blog : www.camdenfamily.com/morpheus/blog Yahoo IM : morpheus "My ally is the Force, and a powerful ally it is." - Yoda > -----Original Message----- > From: Brook Davies [mailto:[EMAIL PROTECTED] > Sent: Sunday, July 06, 2003 4:40 PM > To: CF-Talk > Subject: RE: Caching cfc objects in the application scope > > > Raymond, > > In this code here the array is only populated in the first > position. So it > would once loop once. I did however change the counter/index > to a variable > that is not used inside the loop just to be on the safe side. > But this code > does work some times and then some times it generates the > error I mentioned > yesterday. > > Brook > > At 06:58 AM 7/6/2003 -0500, you wrote: > >So, I did a quick test, and while I didn't get an error, the > use of x > >inside the loop confuses the loop counter and the loop runs > once, not > >twice. > > > ><cfset descriptlistarray = arrayNew(1)> > ><cfset descriptlistarray[1] = "f,g,a,a,a"> > ><cfset descriptlistarray[1] = "z,g,a,a,a"> > > > ><cfset ret = structNew()> > ><cfset ret.cleanedstring =""> > ><cfloop from="1" to="#arraylen(descriptlistArray)#" index="x"> > > <!--- convert the form element descript to an array ---> > > <cfset x=listtoarray(descriptlistArray[x])> > > > > <!--- more code here ---> > > <cfoutput>x5 = #x[5]#</cfoutput> > > <cfset > ret.cleanedstring=listappend(ret.cleanedstring,x[5])> > > </cfloop> > > > >So, like I said, the main thing you want to do is change to a new > >variable inside the loop AND make sure that descriptlist[x] > is a list > >w/ at least 5 members. > > > > > > > > > -----Original Message----- > > > From: Raymond Camden [mailto:[EMAIL PROTECTED] > > > Sent: Sunday, July 06, 2003 5:51 AM > > > To: CF-Talk > > > Subject: RE: Caching cfc objects in the application scope > > > > > > > > > That's what confuses me - if the code did create an > error, it should > > > do it every single time, that is, of course, assuming that this > > > branch of code is running everytime. Something else to > consider, you > > > use the 5th item in the array, are you checking to make sure > > > arrayLen is gte 5? > > > > > > > > -----Original Message----- > > > > From: Brook Davies [mailto:[EMAIL PROTECTED] > > > > Sent: Saturday, July 05, 2003 10:46 PM > > > > To: CF-Talk > > > > Subject: RE: Caching cfc objects in the application scope > > > > > > > > > > > > Right, good catch. I guess thats whats causing the > error. But why > > > > should it? And why would it only cause an error sometimes? > > > > > > > > Brook > > > > > > > > > > > > > > > > > -----Original Message----- > > > > > > From: Brook Davies [mailto:[EMAIL PROTECTED] > > > > > > Sent: Saturday, July 05, 2003 10:30 PM > > > > > > To: CF-Talk > > > > > > Subject: Re: Caching cfc objects in the application scope ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4