How about this?

List=replace(list,",,",", ,","ALL");
If (list.endsWith(",")) list=list & " ";

Then do trim(listGetAt(list,X));

A bit hackish, but it'll work.
-dov 

-----Original Message-----
From: cf coder [mailto:[EMAIL PROTECTED] 
Sent: Monday, March 07, 2005 6:15 AM
To: CF-Talk
Subject: Re: ColdFusion ignores empty list elements

thanks for that guys. I'm still getting an invalid list index error. if
the list has 4 elements and I try to use the listgetat function to get
the 5th element. I get an error. 

QuerySetCell(qTmp,"model", listGetAt(list,5)); 

Is there a way to say if it does not exist, do something else

ex:
<cfscript>

if (listGetAt(list,5)) {
QuerySetCell(qTmp,"model", listGetAt(list,5)); } else{
QuerySetCell(qTmp,"model",""); } </cfscript>

The above code does not work though



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Discover CFTicket - The leading ColdFusion Help Desk and Trouble 
Ticket application

http://www.houseoffusion.com/banners/view.cfm?bannerid=48

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:197655
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to