Graham Samuel wrote:

...
>   set the selected to empty
>
> This last statement resulted in an execution error: “controls don’t
> have the same owner”.

I get a different error, "can't find object", which I would expected because "selected" is an object property, not a global property.

To deselect all objects use "select empty", or loop through all controls with something like:

on DeselectAll
  repeat with i = 1 to the number of controls
     set the selected of control i to false
  end repeat
end DeselectAll

"select empty" will probably be much faster, and certainly simpler to type.


>... if you put
>
> put the number of lines of the selectedObject
>
> into the message box, you get zilch (actually I think you get the
> error described earlier, but I can’t see it). But if you put
>
>  put the selectedObject into temp
>  put the number of lines of temp
>
> You get an integer, as expected.

This one's a gray area.

The selectedObject resolves to an object reference, so as written it seems the engine is attempting to get the number of lines in the object itself (the text property) rather than the object reference string.

To force evaluation to operate on the list of objects rather than the object itself, using parentheses seems to do the trick:

  put the number of lines of (the selectedObject)

--
 Richard Gaskin
 Fourth World Systems
 Software Design and Development for Desktop, Mobile, and Web
 ____________________________________________________________
 ambassa...@fourthworld.com        http://www.FourthWorld.com

_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to