This App is No Longer Maintained. Visit the Replacement at StrokesPlus.net

StrokesPlus Forum
                       
StrokesPlus Forum
Home | Profile | Active Topics
Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 About
 Did you know...
 DYK: Strings in Lua
 Forum Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

Rob

USA
2615 Posts

Posted - 12/31/2011 :  07:42:14  Show Profile  Visit Rob's Homepage
Did you know...

When assigning string values in Lua, you must properly escape certain special characters or you may have unexpected results. For example, if I want to define a string variable to contain "C:\Windows\notepad.exe", I have to write it like this:

strTestString = "C:\\Windows\\Notepad.exe"

If I don't escape the backslashes, "C:\Windows\notepad.exe" literally looks like this to Lua:

"C:Windows
otepad.exe"


Lua simply ignores unknown escape sequences like "\W" and drops the backslash. While the "\n" (from "..\notepad..") is interpreted as a new line.

Click the following link for a full list of Lua escape sequences:

http://www.lua.org/pil/2.4.html
  Previous Topic Topic Next Topic  
 Forum Locked
 Printer Friendly
Jump To:
StrokesPlus Forum © 2011-2018 Rob Yapchanyk Go To Top Of Page
Snitz Forums 2000