>> Further more this only happens with a for loop inside of a cfscript, this
>> does NOT happen inside of a cfloop!
A possible reason for this is that cfloop will not evaluate the
ArrayLen on every iteration of the loop which is very different. While
there doesn't appear to be a good reason for the error, I would
presume (based on the fact that cfloop does not break) that changing
the loop to the following would fix the issue for you:
<cfset test = ["test1","test2"]>
<cfscript>
testLen = ArrayLen(test);
for(i=1; i LT testLen; i=i+1) {
}
</cfscript>
Again, while it shouldn't make a difference in terms of the proble,
the variable 'initText' is not scoped in the udf. Being strict, it
should be scoped in arguments. Simply out of preference, I would not
touch that variable either (ie. it is converted to lcase), and I
modify the udf like so:
function capFirstTitle(initText){
var Words = ListToArray( LCase( arguments.initText ), " " );
var nWords = ArrayLen(Words);
var j = 0;
// etc...
for(j=1; j LTE nWords; j = j+1) {
// etc...
HTH
Dominic
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f
Archive:
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:315594
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4