Retrieve List of Array Properties?

Jeanne A. E. DeVoto revolution at jaedworks.com
Sat Feb 18 15:07:21 EST 2006


At 11:59 AM -0800 2/18/2006, Scott Rossi wrote:
>If I set some custom properties of an object via an array:
>
>   set the specialData["cool"] of fld 1 to "hello"
>   set the specialData["hot"] of fld 1 to "world"
>
>...how do I retrieve a list of the custom property names (are these called
>"indexes"?) of the object?  ("cool", "hot", etc)

There are a couple of ways. One is to use the customKeys to get the 
current set of custom properties, after first setting the current 
property set to the one you want:

   set the customPropertySet of field 1 to "specialData"
   put the customKeys of field 1 into myPropertyList

Alternately, grab the whole array of custom properties, then get the 
array's keys:

   get the customProperties["specialData"] of this stack
   put the keys of it into myPropertyList

The second way is probably cleaner: it doesn't change the current 
custom property set.
-- 
jeanne a. e. devoto ~ revolution at jaedworks.com
http://www.jaedworks.com



More information about the use-livecode mailing list