This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
MulticolouredMarshmellow's profile picture

an error with print()

Started by MulticolouredMarshmellow, 25 February 2013 - 07:31 AM
MulticolouredMarshmellow #1
Posted 25 February 2013 - 08:31 AM
Well the error with print() that I Have never had a problem with before but having it now is:

When I do print("/ \") the quotes don't make the '/ \' turn red, also when I run the program it says "bios:338: [string "printer"]:1: unfinished string"
Is this supposed to happen? It seems like the '/ \' is canceling out the quotes.

Thanks,
Gabrieljw1
Lyqyd #2
Posted 26 February 2013 - 06:42 AM
Split into new topic.

This is expected behavior. \ is an escape character. You will need to use \\ for a single backslash to be used in the string.
remiX #3
Posted 26 February 2013 - 08:58 AM
Or use
print([[ /\ ]])
[[ ]] is used for multi-lined strings for print and write, No need to escape the escape character then
MulticolouredMarshmellow #4
Posted 08 March 2013 - 03:03 PM
Or use
print([[ /\ ]])
[[ ]] is used for multi-lined strings for print and write, No need to escape the escape character then

Thankyou! It worked perfectly!