For fun, something like the below might work (this is completely untested, I
wrote it in the email).

- Calvin

function ListElementExists(l,i,d) {
        var tl = Replace(l,d&d,d&"UDFTEMPITEM"&d,"ALL");
        var result = false;
        if (ListLen(l,d) GTE I AND ListGetAt(l,i,d) IS NOT "UDFTEMPITEM") {
                result = true;
        }
        return result;
}

-----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



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Find out how CFTicket can increase your company's customer support 
efficiency by 100%
http://www.houseoffusion.com/banners/view.cfm?bannerid=49

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:197659
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=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to