Comment about "do" (was clickLine/clickcharchunk)
dunbarx at aol.com
dunbarx at aol.com
Tue May 7 18:18:09 EDT 2013
Peter.
"...Feels like value could be a way round using do statements in some circumstances."
True. But there are times when "do" is unavoidable, and also times when it is invaluable. I use "do" in cases where an object or variable reference had been "distanced" in some way from its initial appearance. For example, in a locked field with some lines of text in it:
on mouseup
put random(99) & return into the clickLine --Works fine. Direct, immediate use of the function
end mouseup
on mouseup
get the clickLine --puts some "distance" between the clickLine as a function and as a string in a variable.
-- put random(99) into it --does not work, though it seems like it should
do "put" && random(99) && "into" && it --works
end mouseup
There are all kinds of reasons why one would want to put such a function somewhere, and use it later.
This all started in 1987, with such functions as "the foundLine". "Do" has a bad rep. It does not deserve it.
Craig
-----Original Message-----
From: Peter Haworth <pete at lcsql.com>
To: How to use LiveCode <use-livecode at lists.runrev.com>
Sent: Tue, May 7, 2013 3:12 pm
Subject: Re: clickLine/clickcharchunk
Thanks Mike, Andre, and Scott. Never used value before so you filled
another gap in my LC knowledge. Feels like value could be a way round
using do statements in some circumstances.
Pete
lcSQL Software <http://www.lcsql.com>
_______________________________________________
use-livecode mailing list
use-livecode at lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
More information about the use-livecode
mailing list