arrays as custom properties or custom property sets
Alex Rice
alrice at arcplanning.com
Wed Aug 27 12:07:00 EDT 2003
On Wednesday, August 27, 2003, at 10:47 AM, rand valentine wrote:
> i have been reading old posts to the list to try and figure out as
> much as
> I can about using custom properties and custom property sets to store
> arrays
> of data. But there is some indeterminancy in the list posts, as one
> might
> expect, since they almost always address very specific needs. So, could
> someone knowledgeable clarify for me how exactly one differentially
> loads
> (and accesses) an array as a custom property versus a custom property
> set? I
> want to have about 6 arrays, all as distinct custom properties, but in
> the
> same set. My reason for doing things this way is simple -- if I make
> each
> array a differnt custom property set, don't i always have to be
> setting the
> custom property set to the appropriate one in order to access that
> array's
> data? Thanks so much.
Rand, you have to make 6 custom property sets. Each set is an array. It
is true you can set a particular set like
set the customPropertySet of this stack to "set1"
get the uWhatever of this stack -- from the current set
However, there is a more convenient syntax you can use to get and set
values using an array notation that does not require you to set the
customPropertySet first:
set the set1[value] of this stack to something -- into set 1
get the setx[value] of this stack -- from set x
get the sety[value] of this stack --- from set y
sometimes it is convenient to go ahead and set the customProperty set
if you are going to be accessing the set a lot. Also then you can use
the customKeys to get the array keys without making a copy of the array.
Hope this helps a little,
Alex Rice, Software Developer
Architectural Research Consultants, Inc.
http://ARCplanning.com
More information about the use-livecode
mailing list