LSL Error: Unrecognized escape sequence. (On Open Simulator)

I found myself scratching my head for a while over this while modifying an LSL script to run on 3RG. The error message was:

Error CS1009: Unrecognised Escape Sequence

It turns out that it’s an C# compiler error caused by an “unexpected character followed by a backslash in a string”.  In my case I had a message to llSay() and I’d used “\n” to create a new line and then inadvertently put an extra backslash, something like this:

llSay(0, "Some message \n\Some message on a new line");

In SL, the script just compiles, but on 3rd Rock Grid (and presumably many other Open Simulator grids) it fails with that error and the editor claims it’s on a line way , way above where the error actually occurs.

Reference:  http://msdn.microsoft.com/en-us/library/44ezxxy3%28v=vs.71%29.aspx

Advertisements

About Miller

I live in Second Life with my shoulder pet Logan. I write code for her and I sometimes greet people in the Virtual Kennel Club Dog Park at Turing Isle: http://slurl.com/secondlife/Turing Isle/128/126/27/ I also write in my own Blog at http://miller.logspark.com and sometimes even on FB.
This entry was posted in LSL, Reminders and tagged , , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s