Retrieve List of Array Properties?

Dave Cragg dcragg at lacscentre.co.uk
Sun Feb 19 03:57:27 EST 2006


On 19 Feb 2006, at 04:05, Ken Ray wrote:

> On 2/18/06 7:50 PM, "Richard Gaskin" <ambassador at fourthworld.com>  
> wrote:
>
>> Scott Rossi wrote:
>>> Recently, Dave Cragg wrote:
>>>> One further way...
>>>>
>>>>  get the customKeys["specialData"] of field 1
>>>
>>> *THIS* is what I had in my mind of how it should work, but  
>>> couldn't get the
>>> syntax right.  Thanks very much Dave.
>>
>> Whoa.  Never seen that before.
>>
>> I have mixed feelings about the syntax, wondering whether () might be
>> more appropriate than [] in that context.
>>
>> Has this been in the docs all these years and I've somehow missed it?
>
> I know what you mean! It *isn't* in the docs AFAICT, so it just  
> goes to show
> you can certainly teach an old dog new tricks..

Does that make me a spring chicken? :-)

It's probably my "old doggish" behavior that accounts for me knowing  
this. The array style runs right through all the syntax relating to  
custom properties, and allows you to avoid specifically setting a  
customPropertySet. Being so set in my ways before the  
customPropertySet syntax was introduced, I've never really adapted to  
it, and rarely think in terms of different property sets.

I always think of customPropertySets as being alternative sets of  
properties, For example, different language versions of error  
mesages, or different settings for different platforms. In these  
cases, it would make sense to set a customPropertySet at startup and  
use that for the rest of the session.

But I find I more often use custom properties to store structured  
data, so have properties such as cUser["id"], cUser["name"], cUser 
["zodiacsign"]. In this case, I don't think of there being a  
customPropertySet named cUser, but a single property named cUser,  
with many attributes. Thus my preference for the array syntax.

Cheers
Dave



More information about the use-livecode mailing list