Change

<cfif ArrayIsEmpty(session.cart[1])>
the array is empty
</cfif>

to

<cfif ArrayIsEmpty(session.cart)>
the array is empty
</cfif>

Assuming that session.cart is not an array of arrays. 

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: 01 October 2001 01:07
To: CF-Talk
Subject: RE: Using CFLoop to delete from an Array 2


OK,

Now that I've got the multiple deletes from the array working (thanks, guys)
. I've got a problem when every element in the array is deleted (an option
a user could conceivably take).

There is later on the page, of course, code that assumes there is going to
be information in the array to read. If everything in the array is deleted,
then there's an error.

The obvious thing to do is set up some sort of conditional to find that the
array has been cleared of all items, but I'm having trouble finding the
right syntax.

I've tried things like:

<cfif ArrayIsEmpty(session.cart[1])>
the array is empty
</cfif>

And variations of other conditional tests and I repeatedly get this error
message:

        "The element at position 1 in dimension 1 of object "session.cart"
cannot
be found.
        The object has elements in positions 1 through 1. Please, modify the
index
expression.

So I've run out of ideas to try to catch this now empty array and through up
some appropriate HTML.

H.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to