How about: <cfscript>
if (listLen(list) EQ 5) { QuerySetCell(qTmp,"model", listGetAt(list,5)); } else{ QuerySetCell(qTmp,"model",""); } </cfscript> On Mon, 07 Mar 2005 07:14:46 -0400, cf coder <[EMAIL PROTECTED]> wrote: > 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 > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:197663 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