'the owner' query

Klaus major-k klaus at major-k.de
Wed Oct 23 11:16:04 EDT 2013


Hi Graham,

Am 23.10.2013 um 17:12 schrieb Graham Samuel <livfoss at mac.com>:

> I'm trying to use the concept of 'the owner' to detect certain grouped controls on a card, where as it happens I want to skip a looped operation on these particular objects. I'm using a construction like:
> 
>   if the owner of tgrcID <> grp "theProtectedGroup" then ...
> 
> In this example tgrcID contains a graphic's ID - in fact it's a line from 'the selectedObjects'. The group mentioned exists and is on the same card. When executed as part of an apparently error-free script, or in the message box in the form
> 
>   put the owner of tgrcID <> grp "theProtectedGroup"
> 
> I get this runtime error:
> 
>> Error description: Factor: error in right operand
> 
> Putting bits of the comparison in brackets, wrapping it up in 'do' etc don't make a difference to the error. Trying to use value(tgrcID) produces a different error.
> 
> If I put this in the message box when I have a specific ID in tgrcID
> 
>   put the owner of tgrcID
> 
> I get the expected answer, i.e. the type and name of the owner. So it looks as if there is a syntactical problem of some kind in the engine.
> 
> Knowing the above, I can do a workaround, by executing something like
> 
>   put the owner of tgrcID into temp
>   put temp <> "grp" && quote & "theProtectedGroup" & quote
> 
> which doesn't give an error, just the expected result (true or false).
> 
> Is it me, or is it a bug?

I think this is correct behavior!
That's why I always check:
...
if the short name of the owner of tgrcID <> "theProtectedGroup" then
...
;-)

> TIA
> 
> Graham

Best

Klaus

--
Klaus Major
http://www.major-k.de
klaus at major-k.de





More information about the use-livecode mailing list