Hi All - Feels like I can never get a handle on structs... Please help! (Thanks 
in advance)

I have a Shopping Cart Array - And I Pass into it all the Options and Choices. 
It all works GREAT.

And while I have managed to get the information INTO the struct - I can't 
figure out how to get the info OUT of the struct....  Maybe I had too much bad 
egg nog...

Here is the list function - which gives me all the data I want (when I cfdump) 
but I can't get certain parts specifically - - Like the VALUE of the CHOICES.

Please Note: The Options and Choices are Structs within the Array - - -

<CFSET CartItem.Options = StructNew()>
<CFSET CartItem.Choices = StructNew()>

LIve Demo - Adding stuff to cart and viewing cart will show a cfdump of TheCart
http://cf.bigfatdesigns.com/cart/store.cfm?AssocID=0&MDID=0&DetailID=14


List function here:

  <CFFUNCTION 
    NAME="List" 
    HINT="Returns a query object containing all items in shopping cart.  The 
query object has two columns: MerchID and Quantity."
    RETURNTYPE="query">

    <!--- Create a query, to return to calling process --->
    <CFSET q = QueryNew("MerchID,Quantity,Weight,Options,Choices")>
    
    <!--- For each item in cart, add row to query --->
    <CFLOOP FROM="1" TO="#ArrayLen(This.CartArray)#" INDEX="i">
      <CFSET QueryAddRow(q)>
      <CFSET QuerySetCell(q, "MerchID",  This.CartArray[i].MerchID)>
      <CFSET QuerySetCell(q, "Quantity", This.CartArray[i].Quantity)>
      <CFSET QuerySetCell(q, "Weight", This.CartArray[i].Weight)>
      <CFSET QuerySetCell(q, "Options", This.CartArray[i].Options)>
      <CFSET QuerySetCell(q, "Choices", This.CartArray[i].Choices)>
    </CFLOOP>

    <!--- Return completed query --->    
    <CFRETURN q>    
  </CFFUNCTION>  

Thanks - - Nick 


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-newbie/message.cfm/messageid:4934
Subscription: http://www.houseoffusion.com/groups/cf-newbie/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.15

Reply via email to