FYI, for those of you who are at the suite when I contradicted MD about
looping in cfscript, I have discovered the method to my madness.
Basically, I said this:
If you loop from 1 to ListLen (or ArrayLen) Foo, and you modify Foo in
the loop, it will NOT create an infinite loop. My reason for this was
that the "ending" condition (len of whatever) was determined first, and
only once. I was promptly proven wrong.
Later on, though, I kept thinking about the situation. I knew I
remembered seeing something like this, but couldn't remember where. Then
I remembered... <CFLOOP>. So, this code WILL create an infinite loop:
for(i=1; i lt listlen(foo); i=i+1) {
foo = listappend(foo,"Your mother wears combat boots");
}
while this will NOT:
<CFLOOP INDEX="I" FROM=1 TO="#ListLen(Foo)#">
..
</CFLOOP>
Of course, the entire reason I brought up the first point was merely to
test to see who was paying attention. At no time did I actually say
something wrong. (In other words, I had an issue - not a bug. ;)
Raymond Camden
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Get the mailserver that powers this list at http://www.coolfusion.com
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists