The titles are outputed unique though? I'd thought with the way that is
written you would get 10 records with the same title, rank, and asin
displayed but I am going on next to no sleep today.
Try replacing:
AddBook = ArrayAppend(BookList,Book);
With
BookList[i] = Duplicate(Book);
On 6/27/06, Howard Owens <[EMAIL PROTECTED]> wrote:
>
> I'm running a specific query against the Amazon API/AWS.
>
> The problem is, certain of my attributes seem to be overwritten by the
> last result of the query set, and I don't understand why.
>
> Here's my script (with some variables removed for brevity):
>
> <cfscript>
> AmazonXML = XmlParse(cfhttp.filecontent);
> BookList = ArrayNew(1);
> Book = StructNew();
> i=1;
> while (i LTE 10)
> {
> Book.ASIN = AmazonXML.ItemSearchResponse.Items.Item
> [i].ASIN.XmlText;
> Book.SalesRank = AmazonXML.ItemSearchResponse.Items.Item
> [i].SalesRank.XmlText;
> Book.Title = AmazonXML.ItemSearchResponse.Items.Item
> [i].ItemAttributes.Title.XmlText;
>
> AddBook = ArrayAppend(BookList,Book);
>
> i=i+1;
>
> }
>
> </cfscript>
>
> Here's the output:
>
> <cfloop index="BookOutput" from="1" to="#ArrayLen(BookList)#">
> <cfoutput>
>
>
>
> Title: #BookList[BookOutput].Title#<br>
> Sales Rank: #BookList[BookOutput].SalesRank#<br>
> ASIN: #BookList[BookOutput].ASIN#<br>
>
> <br>
> <br>
> </cfoutput>
> </cfloop>
>
> Title comes out as unique for all 10 results, but SalesRank and ASIN
> display the values of the last items in the results set.
>
> I don't see why that would be.
>
> H.
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:244884
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