Are you deleting backwards? If not, your code will not work. For example, if you want to remove ites 2 and 4, if you first remove item 2, the old item 4 is now item 3. If you go backwards (delete 4 then 2), then this will not happen.
======================================================================= Raymond Camden, ColdFusion Jedi Master for Mindseye, Inc Member of Team Macromedia Email : [EMAIL PROTECTED] Blog : www.camdenfamily.com/morpheus/blog Yahoo IM : morpheus "My ally is the Force, and a powerful ally it is." - Yoda > -----Original Message----- > From: Bosky, Dave [mailto:[EMAIL PROTECTED] > Sent: Thursday, March 13, 2003 10:38 AM > To: CF-Talk > Subject: Arrays -Deleting specific items > > > I have an array and need to delete specific positions by > using a list of positions to delete. Array contains 8 items > and I need to delete the items at positions "2,3,4,5,6". > > I've been using the code below and it works most of the time > if I delete one at time but once I try to delete multiple > items it errors out. I'm obviously overlooking something and > extra eyes would be great! > > <CFSCRIPT> > INDEX_TO_DELETE = > LISTSORT(form.INDEX_TO_DELETE,"NUMERIC","DESC"); > > FOR (INDEX=1;INDEX LTE ListLen(form.index_to_delete); > INDEX=INDEX+1) { > > ArrayDeleteAt(session.aCart,ListGetAt(form.index_to_delete,index)); > } > > </CFSCRIPT> > > Thanks, > Dave > > > > > HTC Disclaimer: The information contained in this message > may be privileged and confidential and protected from > disclosure. If the reader of this message is not the intended > recipient, or an employee or agent responsible for delivering > this message to the intended recipient, you are hereby > notified that any dissemination, distribution or copying of > this communication is strictly prohibited. If you have > received this communication in error, please notify us > immediately by replying to the message and deleting it from > your computer. Thank you. > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Get the mailserver that powers this list at http://www.coolfusion.com Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

