+Krolock Posted April 11, 2012 Share Posted April 11, 2012 If you define a line break in lua like local nr = 1 local message = "Row ".. nr ..[[ Row ]] .. (nr+1) in an external lua file and build the project, the resulting _cartrigde.lua contains the following code: local nr = 1 local message = "Row ".. nr ..[[Row ]] .. (nr+1) The line break only disappears if no charactor or only whitespace are written behind the square brackets "[[" If you define code like local nr = 1 local message = "Row ".. nr ..[[ Bla Row ]] .. (nr+1) the line break won't disappear It does not matter if you write the code in an external file or in urwigo directly. If you activate the "Inline lua 'require'" checkbox, the line break will disappear. see the given example as attachement Krolock LineBreakTest.zip Quote Link to comment
+charlenni Posted March 28, 2014 Share Posted March 28, 2014 While searching for informations to "line breaks", I found this unanswered question. It is correct behavior. The Lua definition says For convenience, when the opening long bracket is immediately followed by a newline, the newline is not included in the string. You could find this in the Lua 5.1 manual in section 2.1 - "Lexical Conventions". Quote Link to comment
+Krolock Posted April 1, 2014 Author Share Posted April 1, 2014 Thanks for your answer. I will publish this lua behaviour in my blog the next days Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.