You need to put quotes in isDefined... and you probably want to use
StructKeyExists (although isDefined will probably let you skip some levels
of checking, since you need to know that the parent struct exists if you use
StructKeyExists

> -----Original Message-----
> From: Howard Owens [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, June 27, 2006 7:36 PM
> To: CF-Talk
> Subject: I know it's not defined ... that's the problem
> 
> I'm still working on my Amazon AWS application.
> 
> Got one query working, now I want to reuse some code.
> 
> But the new query doesn't return quite the same results set XML.
> 
> So for SalesRank, I run into an "undefined" error, so I thought I'd try
> the following, but it returns the same error ... how do I test for whether
> an element is there, and skip it if it isn't?
> 
> if(IsDefined(AmazonXML.ItemSearchResponse.Items.Item[i].SalesRank.XmlText)
> ) {
>               Book.SalesRank =
> AmazonXML.ItemSearchResponse.Items.Item[i].SalesRank.XmlText;
>       }
> else {
>               Book.SalesRank = '';
>       }
> 
> 
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:244939
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