Discussion Locked

coldfusion array error

0 helpful
1 reply
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Help please

getting the following error:

Object of type class java.lang.String cannot be used as an array

from following code:

1 reply

by alexeiramone

Try this:

1) Provide a type in , it this case, array and try not to set the default to arraynew(), leave this and define the array in further cfset.

2) Try not to add the struct directly in arrayappend like you did in arrayAppend(session.cart,structNew()). Try something like this: arrayAppend(session.cart,uSomething) and after, define it as a struct.

This discussion is closed to new replies.