set selectedText?
Martin Baxter
martin at materiaprima.fsnet.co.uk
Thu Nov 18 17:26:54 EST 2004
>While we are on this topic, why is it that I can say:
>
>put selectedLine of the target into temp
>delete temp
>
>but not
>
>delete selectedLine of the target
>
>What is the fundamental point I am missing?
>--
>
>Kaveh Bazargan
Well, er, let's see ...
The target will presumably be whatever you just clicked.
Suppose the target is an object that has lines (eg a field) and clicking on
it results in your first script executing , then temp would contain a
string of the form : "line n of field x"
so in the first example, the second line evaluates to:
delete line n of field x
which is OK syntax
However in the second example, if the target is field x, then the statment
would be
delete line n of field x of the target
Or: delete line n of field x of field x
Field x can't be the owner of field x. To be the owner of field x, the
target would have to be a card or a group or a stack.
But if the script ran because you clicked the card for instance, the
statement would mean:
delete selectedline of card n
cards don't have selectedlines so selectedline so I would expect an error:
===
Having said all that, I can't actually remember the last time I used "the
target" for anything, it's not part of my scripting style, trying to answer
your question has maybe reminded me why :-)
====
Does that help ?
Martin Baxter
More information about the use-livecode
mailing list