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

Creating an unknown number of variables is a natural fit for arrays:

on mouseUp
   get "AA" & return & "BB"
   repeat with y = 1 to 2
      put it into temp[y]
   end repeat
   answer temp[2]
end mouseUp

--
 Richard Gaskin
 Fourth World
 LiveCode training and consulting: http://www.fourthworld.com
 Webzine for LiveCode developers: http://www.LiveCodeJournal.com
 LiveCode Journal blog: http://LiveCodejournal.com/blog.irv

_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to