I am building a CAD-like drawing program in LC, and as a convenience I made a gadget to allow me to hide graphics if I simply click on them with the optionKey. I want only graphics to hide. So I tested three conditions:
Code: Select all
if the optionKey is down and the mouseControl <> empty and the name of the mouseControl contains "graphic"
then hide the mouseControl --works fine
--if the optionKey is down and the name of the mouseControl contains "graphic" and the mouseControl <> empty
--then hide the mouseControl --fails
The card object is not a mouseControl, the function returning empty.
I assume this means that each condition is evaluated sequentially, and clicking on empty space throws an error since the test for graphic "fails" before the empty result from the function "fails".
The pecking order matters, even though each condition on its own is identical between the two versions. I do not see a reason for this at all.
Expected behavior?
Craig