Storing an Array as a Custom Property

Phil Davis revdev at pdslabs.net
Fri Oct 1 13:21:19 EDT 2010


  On 10/1/10 9:04 AM, Gregory Lypny wrote:
> Hi everyone,
>
> Page 236 of the LiveCode user guide says that arrays cannot be stored as single custom properties.  Can anyone confirm this please?  The reason I ask is that I thought that I had read in a past Rev newsletter that it was now possible, but I may be mistaken.
>
> I'm developing an app in LiveCode and have been saving uni-dimensional arrays as single customs props without apparent problems; however, it may be another story with multi-dimensional arrays.

For multi-dimensional arrays you need arrayEncode() and arrayDecode():

put "ice cream" into aMyFoods["favorites"]["desserts"]["cold"]
set the uMyFoods of stack "dataContainer" to arrayEncode(aMyFoods)

> Regards,
>
> Gregory

-- 
Phil Davis

PDS Labs
Professional Software Development
http://pdslabs.net




More information about the use-livecode mailing list