Comment about "do" (was clickLine/clickcharchunk)

Peter Haworth pete at lcsql.com
Tue May 7 19:18:00 EDT 2013


On Tue, May 7, 2013 at 3:18 PM, <dunbarx at aol.com> wrote:

> 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:
>

Sure, I have nothing particularly against "do" except that coding it can
look messy.


>
>
>
>
> on mouseup
>    put random(99) & return  into the clickLine --Works fine. Direct,
> immediate use of the function
> end mouseup
>

That's where I think clickline can't decide if it's a string or a reference
to a string.  Put "xyz" into the clickline does what you'd expect but put
the clickline into tVar doesn't (at least not what I expected)

>
>
> 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
>

Does "put random(99) into value(the clickline)" work?  Haven't tried it but
if it does, it seems less messy than constructing a do statement.


>
>
> 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.
>

 I agree, except for the "messy code" comment above.


>
> 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
>
>
>
> _______________________________________________
> 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