
-----------------------------------
Lanks
Thu Mar 26, 2009 8:24 am

String literal ends at end of line
-----------------------------------
WHAT?!?!?! can turing not handle 

                    put  "\"

if you run that it will give you an error : "String literal ends at end of line"
anyone know a workaround?

i am trying to draw a ghost using ascii and it won't place the backslashes...

-----------------------------------
DemonWasp
Thu Mar 26, 2009 9:43 am

RE:String literal ends at end of line
-----------------------------------
Backslashes are an escape character, meaning that the second double-quote is being interpreted as part of the string, rather than the end of the string.

put "\\" .

Edit: I should mention - this isn't a workaround. It's a feature. I'm not saying that in the sarcastic sense either, this really is a feature; it's the only way to get certain characters into strings.

-----------------------------------
andrew.
Thu Mar 26, 2009 5:16 pm

RE:String literal ends at end of line
-----------------------------------
I know that Java does this as well. Like DemonWasp said, you can't work around it, it's built in to Turing.

-----------------------------------
DemonWasp
Thu Mar 26, 2009 7:26 pm

RE:String literal ends at end of line
-----------------------------------
It's pretty standard; Java additionally allows for \u#### in some cases for internationalisation purposes.

-----------------------------------
Lanks
Thu Mar 26, 2009 7:55 pm

RE:String literal ends at end of line
-----------------------------------
thanks! that will work just fine
