Do a ListLen(str, "$") to see if the second element is present first.

Adrian
http://www.adrianlynch.co.uk/

-----Original Message-----
From: Che Vilnonis
Sent: 05 February 2008 20:59
To: CF-Talk
Subject: String Manipulation Fun


Take the following xml string value:
        1969 Chevrolet Camaro - Windsor, ON N8W 5J1 - $44900

I use the following code to extract and set the price:

<cfif findNoCase("$", theArray[i].description.xmlText)>
        <cfset price = listlast(theArray[i].description.xmlText, "$")>
</cfif>

Sometimes though, the xml data is incomplete and looks like this:
        1969 Chevrolet Camaro - Windsor, ON N8W 5J1 - $

My current logic bombs on the listlast statement. Any ideas how to fail
gracefully and set the price to zero when this happens?

Thanks, Che

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:298261
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to