Literal Basckslash?

Posted by Zim on Wed 04 Feb 2015 12:56 AM — 3 posts, 13,306 views.

#0
Let's say I have a line of code like this:

southeast = {x = 1, y = -1, chr = "\"}


I want chr to equal the ascii backslash char. I've tried using double backslashes but I still get this error:


Immediate execution
[string "Trigger: "]:70: unfinished string near '"")},'


I've looked into using the function FixupEscapeSequences() but I can't get that to work either. I'm also under the impression that FixupEscapeSequences() is unnesessary in Lua.
Amended on Wed 04 Feb 2015 01:05 AM by Zim
Australia Forum Administrator #1
In "send to script" backslashes are preprocessed by the client, before it even reaches Lua. So you have to use four of them:


southeast = {x = 1, y = -1, chr = "\\\\"}
#2
Thank you!