How do I use customProperties

Klaus Major k_major at os.surf2000.de
Tue Feb 11 12:31:01 EST 2003


Hi Graham,

> I seem to be forever stuck in a half-understanding of Transcript/Revo. 
> The latest problem is that I want to do an existence test for a 
> particular custom property. I already know I can't script
>   if exists(the myOddProperty of image "thing" of this cd) then...
> as someone has already explained to me that a property is not an 
> object, and so in this rather technical sense doesn't exist. My next 
> attempt was to
>  get the customProperties of image "thing" of this cd
>  if "myOddProperty" is in it then...
>
> This doesn't work either, presumably because the customProperties is 
> an array, although you would have thought that the indices of an array 
> (element references) would be in there somewhere. There is not that 
> much about arrays in the documentation (the entry under ']' in the 
> Transcript Dictionary is quite useful, but it took some finding).
> I then tried
>  get the customProperties of image "thing" of this cd
>  if exists(it["myOddProperty"]) then...
> But that doesn't work either (I suppose an array element isn't an 
> object).
>
> I'm sure the answer is simple, but I can't find it. Help appreciated.
>
> TIA
>
> Graham

"customkeys" is the magic word :-)

...
   if (lineoffset("myOddProperty",the customkeys of img "thing") <> 0) 
then
    ## do your stuff here
   end if
...


Hope that helps.


Regards

Klaus Major
k_major at os.surf2000.de




More information about the use-livecode mailing list