How do you do it??

dunbarx at dunbarx at
Fri Dec 23 16:43:48 EST 2011

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


More information about the Use-livecode mailing list