Storing an Array as a Custom Property
Mike Bonner
bonnmike at gmail.com
Fri Oct 1 14:06:32 EDT 2010
You can put multidimensional arrays into properties, at least as of what..
3.5? If I recall correctly, the only real issue with this is that you have
to pull the whole thing back out as a unit to work with it. I'm not
positive, but I don't think it arrayencodes and decodes when you get and
set. bit not sure. When looking at a property that is an array in the
inspector it says this:
*
The value of this custom property is an array and can only be edited in the
Property inspector if it is first converted into a string. Doing this will
empty the array. If you are sure you want to do this, double click on this
field*
On Fri, Oct 1, 2010 at 11:21 AM, Phil Davis <revdev at pdslabs.net> wrote:
> 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
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>
More information about the use-livecode
mailing list