How do I use customProperties

Graham Samuel livfoss at blueyonder.co.uk
Tue Feb 11 11:50:01 EST 2003


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
-- 
-------------------------------------------------------------------
          Graham Samuel / The Living Fossil Co. / UK & France



More information about the use-livecode mailing list