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

Help With Code![SOLVED]

Started by con2000, 01 June 2012 - 11:01 PM
con2000 #1
Posted 02 June 2012 - 01:01 AM
it Keeps saying

bios:206: [string "startup"]:8: unfinished string

Code:

write ("Age")
age = read()
write ("BirthDay")
BirthDay = read()
write ("Name")
Name = read()

print ("Your name Is "..Name.." and
your "..age.." years old, also You Were Born
On "..BirthDay.."")

sleep(10)
rs.setOutput ("left", true)
sleep(3)
rs.setOutput ("left", false)
os.reboot()
end

I Tried To Fix Myself By Going Over It
And Could not Find A Thing
cant_delete_account #2
Posted 02 June 2012 - 01:09 AM
Here's the fixed code:

write("Age: ")
local age = read()
write("Birthday: ")
local bday = read()
write("Name: ")
local name = read()
print("Your name is "..name..", you are "..age.." years old, and you were also born on "..bday..".")
sleep(10)
rs.setOutput("left", true)
sleep(3)
rs.setOutput("left", false)
os.reboot()
MysticT #3
Posted 02 June 2012 - 01:28 AM
Just so you know what the error was:
If you want to write a string on multiple lines you have to use [[ and ]], like this:

[[This is a
multi line string.
Really cool]]
If you use quotes (") you have to close it on the same line:

"This is a single line string, you can't put new lines here"
con2000 #4
Posted 02 June 2012 - 02:04 AM
Thank U It WORKED!! WOOT :)/>/>