Arrays as custom properties?

Mark Smith mark at maseurope.net
Sun Mar 19 07:13:39 EST 2006


You can simply store an array variable as a customPropertySet:
set the customProperties["addresses"] of this stack to addressArray

You can then set individual elements of the stored array:
set the addresses[key] of this stack to someItem

And retrieve the indidvidual elements:
get the addresses[key] of this stack

or put the whole thing back into an array variable:
put the customProperties["addresses"] of this stack into addressArray

The thing is that a customPropertySet effecively <is> an array,  and  
depending on your needs, (accessing a customPropertySet is only  
slightly slower than accessing an array) may be a better choice than  
a global/local array variable.

Mark



On 19 Mar 2006, at 06:26, John Tregea wrote:

> Thanks Scott,
>
> I already have a number of arrays stored in global variables and  
> want to store each complete array as a custom property of the  
> group. I realise I could repeat through the structure of the array  
> and transfer each array element to a corresponding element in the  
> group's custom property, but hoped to be able to "plonk" the array  
> into the custom property.
>
> I will check my use of the word "the"...
>
> -----------------------------------
>
> Scott Rossi wrote:
>> Recently, John Tregea wrote:
>>
>>
>>> I have been looking to see if I can set an array as a custom  
>>> property of
>>> a group.
>>> ... I get an error message on execution that says "bad index  
>>> expression"
>>>
>>
>> Yes, you need to define an index for the array.  Perhaps you mean  
>> something
>> like this:
>>
>>   set the myAccess["password"] of group "A" to gMyAccess
>>
>> To retrieve:
>>
>>   get the myAccess["password"] of group "A"
>>
>> Also, I believe a custom property must always be prefaced by "the".
>>
>> Regards,
>>
>> Scott Rossi
>> Creative Director
>> Tactile Media, Multimedia & Design
>> -----
>> E: scott at tactilemedia.com
>> W: http://www.tactilemedia.com
>>
>> _______________________________________________
>> 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
>>
>>
>>
> _______________________________________________
> 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