How do you do it??
bonnmike at gmail.com
Fri Dec 23 16:58:53 EST 2011
You don't want to preparse 'it'.
If you change it to
get quote && "AA" & return & "BB" & quote
repeat with y = 1 to 2
do "put it into temp" & y
it works fine.
The other way 'do' sees this..
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
On Fri, Dec 23, 2011 at 2:43 PM, <dunbarx at aol.com> wrote:
> Why do LC (and HC for that matter) fail to process multi-line variables
> when using "do"?
> on mouseUp
> --get "AA" & return & "BB"
> get "AA"
> repeat with y = 1 to 2
> do "put" && it && "into temp" & y
> end repeat
> answer temp2
> end mouseUp
> If the variable "it" contains one line, the "do" construction
> works fine, making numbered temp variables as needed. But if I try the
> routine with a multi-line "it", the handler
> will not compile.
> LC complains as: execution error at line 5 (do: error in source
> expression) near "put AA", char 1
> HC complains as well, that it cannot understand "BB".
> It seems that the routine breaks simply because of the other lines, that
> the next line in "it" is not understandable by the parser. I wonder why it
> bothers to look there.
> Don't tell me I need two levels of "do": (do "do put...) Just kidding,
> that fails also.
> Just asking.
> Craig Newman
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
More information about the Use-livecode