- see footer for list info -<
Dang, hadnt seen all responses when I replied. I think you may have it Russ,
the array does get repopulated though it doesn't happen often. In this case
I think using cflock on it should do the trick? Although it still doesn't
make sense to me that it was looking at an element that is above the length
of the array (the array could not have grown in this instance), arghghgh.
The array is automatically created when a cfxml object is created from an
xml file, there shouldnt be any gaps.
Dom
On 08/09/06, Dominic Watson <[EMAIL PROTECTED]> wrote:
Oh woops, the code in question uses EQ not =.
The array is actually in the application scope (don't ask) and is a node
in an xmlObject. I have just realised that I have not been using cflock when
using the application variable, am doing so now - could this be it?
The actual code:
<cfif structKeyExists(member.xmlData.blog, 'entry')>
<cfloop from="1" to="#arrayLen(member.xmlData.blog.entry)#" index="i">
<cfif member.xmlData.blog.entry [i].id.xmlText EQ iID>
<!---- stuff --->
</cfif>
</cfloop>
</cfif>
The error definately refers to the entry node and the element that the app
is trying to get at is always one more than there are (if there were 20
elements, it would have been looking at 21).
Dom
On 08/09/06, Stephen Moretti <[EMAIL PROTECTED]> wrote:
>
> >- see footer for list info -<
> On 08/09/06, RichL <[EMAIL PROTECTED] > wrote:
> > >- see footer for list info -<
> > Stephen
> >
> > I thought that but if you try the following where arrayLen is 0 it
> > doesn't fall over:
> >
> Oh thats a good point, cos it would only get to 0 in the loop if you
> had step="-1" on the loop.
> Going from 1 to 0 skips over the content of the loop if you're using
> the default step="1"
>
> Duncan's suggestion is probably the cause in which case Dom would
> still need to look at how myArray is being populated and if using an
> Array is really appropriate if you've got missing indexes in the
> array.
> _______________________________________________
>
> 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 <http://www.gradwell.com/> -<
> >- CFdeveloper is run by Russ Michaels, feel free to volunteer your help
> -<
>
--
Blog it up: http://blog.dominicwatson.co.uk
--
Blog it up: http://blog.dominicwatson.co.uk
_______________________________________________
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 -<