do <cfset myList=ArrayToList(oddsoptions,",")> instead ----- Original Message ----- From: "Palyne Gaenir" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, October 31, 2001 11:46 PM Subject: Arrays
> Thanks to helpful answers and digging through books and help files, > I've ended up learning more about arrays today than I have in 2 years > (skills long overdue). Coded half a dozen things tonight I've wanted > to do for a year. Cool. Thanks for all the good input here (to me and > others), I really appreciate the expertise on this list. > > So at the end of the night, I have one persistent error I can't seem > to solve. I tried copying code directly from the Studio help example > even, yet still it errors the same! I've created an array, and sorted > it, and then am attempting to use the function to make it into a list > (which I thought would be easier to output using a list cfloop). > > The array was created dynamically: > <cfset oddsoptions=ArrayNew(1)> > <cfset variables.count = 1> > <cfloop index="c" from="7" to="49" step="7"><cfset > oddsoptions[#variables.count#]=#c#><cfset variables.count = > variables.count + 1></cfloop> > <cfloop index="d" from="11" to="275" step="11"><cfset > oddsoptions[#variables.count#]=#d#><cfset variables.count = > variables.count + 1></cfloop> > <cfloop index="e" from="20" to="300" step="20"><cfset > oddsoptions[#variables.count#]=#e#><cfset variables.count = > variables.count + 1></cfloop> > > Then I sort the array, which seems to go ok (at least, it doesn't > give me any error message). > <cfset sortedodds=ArraySort(oddsoptions, "numeric", "asc")> > > But when I then try and make it a list: > <cfset myList=ArrayToList(sortedodds,",")> > > I get the error: > > An error occurred while evaluating the expression: > myList=ArrayToList(sortedodds,",") > Parameter 1 of function ArrayToList which is now "YES" must be an > indexed object such as an array or a query column > > I keep going back to the code example in Studio, but I can't see > anything different about how its done there vs. how I'm doing it. > Does anyone know what the problem might be here? > > Many thanks. > Palyne > > > ------------------------------------------------------------------------- > This email server is running an evaluation copy of the MailShield anti- > spam software. Please contact your email administrator if you have any > questions about this message. MailShield product info: www.mailshield.com > > ----------------------------------------------- > To post, send email to [EMAIL PROTECTED] > To subscribe / unsubscribe: http://www.dfwcfug.org > ------------------------------------------------------------------------- This email server is running an evaluation copy of the MailShield anti- spam software. Please contact your email administrator if you have any questions about this message. MailShield product info: www.mailshield.com ----------------------------------------------- To post, send email to [EMAIL PROTECTED] To subscribe / unsubscribe: http://www.dfwcfug.org
