> I am having a problem appending a struct to an array... from the examples
> posted at:
> http://www.macromedia.com/v1/handlers/index.cfm?id=18894&method=full#2 it
> looks to me as if I'm doing it correctly.  The error message states that
> "One dimensional arrays can store any value types"... the array
> session.cart is a one dimensional array, so I'm totally confused.  Can
> anyone see what I'm doing wrong?  Thanks.
>       
> <cfset cartItem = structnew()>
> <cfset cartItem.id = "1">
> <cfset cartItem.name = "test">
> <cfset cartItem.price = "test">
> <cfset cartItem.quantity = "1">
> 
> <cfif not(isdefined("session.cart")) >
>       <cfset session.cart = arraynew(1)>
> </cfif>
> 
> <cfscript>
>       AddIt = ArrayAppend(session.cart, cartItem);
> </cfscript> 
> 
> -------------------------------------------------
> An error occurred while evaluating the expression: 
>               AddIt = ArrayAppend(session.cart, cartItem);
> ArrayAppend(Array, Value): cannot append Value to array. One dimensional
> arrays can store any value types. However, multi-dimensional arrays can
> only store arrays of dimension one less than their own. For example, if A
> was a two-dimensional array, the assignment A[3] = ArrayNew(1) would
> execute successfully, but A[3] = 5 will generate an error.
> ------------------------------------------------------
> 
> 
> v/r, Jeff
______________________________________________________________________
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists


Reply via email to