It works for structures, but not for Lists, Queries and Arrays... Iterators would extend any collection (or Thing that can be exposed as a collection - almost like Queries currently in cftags) to be iterable with a simple x.next() method or 'for x in y' loop.
Hardy -----Original Message----- From: Matt Liotta [mailto:[EMAIL PROTECTED] Sent: 27 September 2003 09:59 PM To: [EMAIL PROTECTED] Subject: Re: [CFCDev] For in loops and the need for Iterators > Why on earth can one not loop over lists and arrays with CFScript 'for > x in y'�loops? > Works fine for me. <cfscript> c = StructNew(); c.foo = "something"; c.bar = "something else"; for(key in c) WriteOutput(c[key]); </cfscript> Matt Liotta President & CEO Montara Software, Inc. http://www.MontaraSoftware.com (888) 408-0900 x901 ---------------------------------------------------------- You are subscribed to cfcdev. To unsubscribe, send an email to [EMAIL PROTECTED] with the word 'unsubscribe cfcdev' in the message of the email. CFCDev is run by CFCZone (www.cfczone.org) and supported by Mindtool, Corporation (www.mindtool.com). An archive of the CFCDev list is available at www.mail-archive.com/[EMAIL PROTECTED] ---------------------------------------------------------- You are subscribed to cfcdev. To unsubscribe, send an email to [EMAIL PROTECTED] with the word 'unsubscribe cfcdev' in the message of the email. CFCDev is run by CFCZone (www.cfczone.org) and supported by Mindtool, Corporation (www.mindtool.com). An archive of the CFCDev list is available at www.mail-archive.com/[EMAIL PROTECTED]
