Retrieving the Keys of a Custom Property Set
Mac OS 9 Mac OS X Windows Linux

This question was asked on the Use-Revolution List:

>> 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"
>> do I retrieve a list of the custom property names (are
>> these called "indexes"?) of the object? ("cool", "hot", etc)

Scott Rossi replied:

> 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.

Dave Cragg, however, provided the simplest "one-liner" to get this job done:

get the customKeys["specialData"] of field 1

Posted on 2/18/2006 by Dave Cragg to the Use-Revolution list