- see footer for list info -<
Stephen
I thought that but if you try the following where arrayLen is 0 it
doesn't fall over:
<cfset myArray = arrayNew(1)>
<cfoutput>#arrayLen(myArray)#</cfoutput>
<cfloop from="1" to="#arrayLen(myArray)#" index="i">
<cfif myArray[i] is 'eat my shorts'>
<!---- do stuff --->
</cfif>
</cfloop>
but yes there was an '=' in that original code which should have been 'EQ'
On 9/8/06, Adrian Lynch <[EMAIL PROTECTED]> wrote:
>- see footer for list info -<
Change
<cfif myArray[i] = 'eat my shorts'>
to
<cfif myArray[i] EQ 'eat my shorts'>
Not sure why it's giving you that error though :OS
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Dominic Watson
Sent: 08 September 2006 12:02
To: Coldfusion Development
Subject: [CF-Dev] Error looping an array
>- see footer for list info -<
Hi guys, I'm getting an error I can't fathom. It's an index out of bounds
error while looping an array and it it only happens about 0.5% of the time,
seemingly randomly.
The code looks something like this:
<cfloop from="1" to="#arrayLen(myArray)#" index="i">
<cfif myArray[i] = 'eat my shorts'>
<!---- do stuff --->
</cfif>
</cfif>
The index out of bounds error is occurring on the 'eat my shorts' line. How
might this be?
Dom
_______________________________________________
For details on ALL mailing lists and for joining or leaving lists, go to
http://list.cfdeveloper.co.uk/mailman/listinfo
--
CFDeveloper Sponsors:-
>- cfdeveloper Hosting provided by www.cfmxhosting.co.uk -<
>- Lists hosted by www.Gradwell.com -<
>- CFdeveloper is run by Russ Michaels, feel free to volunteer your help -<
_______________________________________________
For details on ALL mailing lists and for joining or leaving lists, go to
http://list.cfdeveloper.co.uk/mailman/listinfo
--
CFDeveloper Sponsors:-
>- cfdeveloper Hosting provided by www.cfmxhosting.co.uk -<
>- Lists hosted by www.Gradwell.com -<
>- CFdeveloper is run by Russ Michaels, feel free to volunteer your help -<
--
Rich
_______________________________________________
For details on ALL mailing lists and for joining or leaving lists, go to
http://list.cfdeveloper.co.uk/mailman/listinfo
--
CFDeveloper Sponsors:-
- cfdeveloper Hosting provided by www.cfmxhosting.co.uk -<
- Lists hosted by www.Gradwell.com -<
- CFdeveloper is run by Russ Michaels, feel free to volunteer your help -<