How do I Create a Custom Property

David Burgun dburgun at dsl.pipex.com
Wed Apr 21 08:13:06 EDT 2004


>On Mittwoch, Apr 21, 2004, at 13:38 Europe/Zurich, David Burgun wrote:
>
>>...
>>
>>2.  I need to create a Custom Property and set it to ValueX ONLY if 
>>it doesn't already exist, if it does exist then I want it to be 
>>left untouched.
>>
>>So for number 1, I just need to set the Custom Property, but for 
>>number 2, how can I tell if the Custom Property exists?
>
>An existing property returns a value. So you could ask for it like this:
>get the MyCustomProp of this stack
>if it = emtpy then //does not exist or is empty
>end if
>
>Of course this does not help when you have lots of empty properties 
>that you want left untouched. Alternatively you could thus get the 
>customKeys, and query if your property is already there:
>get the customKeys of this stack
>if MyCustomProp is not among the lines of it then // no such property
>end if
>
>>Also, what is the intended use of the "customKeys" and what does it 
>>actually save in "myCustomKeys" after executing this line:
>>
>>   put the customKeys of this stack into myCustomKeys
>>
>>Specifically, does it return a list/array or a string or what? How 
>>Can I appended to it and then set is back again using the following 
>>line:
>>
>>    set the customKeys of this stack to myCustomKeys
>
>The customKeys is a list of items, delimited by lineendings. So if 
>you want to append something you would do it like this:
>
>put the customKeys of this stack into myCustomKeys
>put return & "myNewCustomProp" after myCustomKeys
>set the customKeys of this stacj to myCustomKeys

Thanks a lot, what is the item delimiter for this list? Is it always 
the same an all lists? I typed in "list" and "array" in the 
Transscript Dictionary, but there is nothing there that tell me 
anything, even though when looking at commands (like "customKeys") it 
mentions things like "propertylist". Just wish they would give a 
definition of the parameters in commands etc.

Thanks a lot
Dave


More information about the use-livecode mailing list