How about trying the Arraylen() function? Kevin Langevin Web Guy in Charge UsWebGuys 954-327-5780 [EMAIL PROTECTED]
> -----Original Message----- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] > Sent: Sunday, September 30, 2001 8:07 PM > 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. > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.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

