Retrieve List of Array Properties?

Richard Gaskin ambassador at fourthworld.com
Sat Feb 18 15:07:12 EST 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)
> 
> I've been through the keys(), customKeys, customProperties, etc entries in
> the docs and can't seem to get my head around how this works.

The customPropertySet is the clue:

  function GetSetKeys pObject, pSetName
     -- Store original prop set for later:
     put the customPropertySet of pObj into tSaveSet
     -- Set to desired prop set:
     set the customPropertySet of pObj to pSetName
     -- Get the keys of that set:
     put the customKeys of pObj into tKeys
     -- Restore the original set:
     set the customPropertySet of pObj to tSaveSet
     -- Return the keys:
     return tKeys
   end GetSetKeys

--
  Richard Gaskin
  Managing Editor, revJournal
  _______________________________________________________
  Rev tips, tutorials and more: http://www.revJournal.com



More information about the use-livecode mailing list