Arrays as custom properties?
mark at maseurope.net
Sun Mar 19 06:13:39 CST 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.
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
>> Yes, you need to define an index for the array. Perhaps you mean
>> 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".
>> 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:
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
More information about the use-livecode