How do you do it??

Mike Bonner bonnmike at gmail.com
Fri Dec 23 18:09:36 EST 2011


The problem is you want "put" to evaluate the variable, but the way you're
entering it, livecode evaluates it BEFORE the do.

if you just

on mouseup
put field 1 into fo
do "put foo into field 2"
end mouseup

it will work. do "put foo into field 2"
is the same as
put foo into field 2

the other way since the foo is outside of quotes its evaluated and turns
into the contents of field foo. If there is a return in the field then when
foo is evaluated (do "put" && foo)

it turns into
put line1 of foo
line 2 of foo  into wherever (meaning the values)

effectively what is happening is the value of FOO is becoming part of the
script, rather than the value of foo being used by the script.

Not explaining very well but hopefully this'll get it there.


On Fri, Dec 23, 2011 at 4:00 PM, <dunbarx at aol.com> wrote:

> Mike.
>
>
> Not sure I am getting this. I have two fields, one with several lines of
> text ("fld 1").
>
>
> on mouseUp
>  put fld 1 into foo
>  do "put" && foo && "into fld 2"
> end mouseUp
>
>
> This fails. If fld 1 contains only one line, no problem, as everyone but
> me seems to know. Please tell me again.
>
>
> Thanks,
>
>
> Craig
>
>
>
> -----Original Message-----
> From: Mike Bonner <bonnmike at gmail.com>
> To: How to use LiveCode <use-livecode at lists.runrev.com>
> Sent: Fri, Dec 23, 2011 12:42 pm
> Subject: Re: How do you do it??
>
>
> Well yeah because "do" is a unit.  part fails, all fail so the AA never
> gets to the msg box. Explanation still stands though.
>
>
> On Fri, Dec 23, 2011 at 3:29 PM, Bob Sneidar <bobs at twft.com> wrote:
>
> > It won't even put AA into the message box. It will try to compile the
> > entire do statement first, and upon failing will just throw an error.
> >
> > Bob
> >
> >
> > On Dec 23, 2011, at 1:58 PM, Mike Bonner wrote:
> >
> > > put AA
> > > BB into temp2
> > > So it will put AA into the message box, and error out on the next line
> > > since there is no handler named BB
> >
> >
> > _______________________________________________
> > 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
>
>
>
> _______________________________________________
> 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