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

eof problem

Started by ifar127, 14 July 2012 - 02:36 PM
ifar127 #1
Posted 14 July 2012 - 04:36 PM
everytime i write a program, it wont let me end it, and when i do type 'end' at the end of the program, it keeps saying '<eof>' expected. Im almost completely clueless to coding and programing, so i'm not sure how to help this.
ifar127 #2
Posted 14 July 2012 - 05:43 PM
here is an example of just a simple program i want to use to shut some piston doors:

print = ("Closing Gates…")
sleep(2)
redset = true
end

the error i get is:

bios:206: [string "close"]:4: 'eof' expected

Please help! i have no idea what im doing wrong!
MysticT #3
Posted 14 July 2012 - 06:24 PM
Remove the "end", it's not needed there.
end is used to close blocks, like if, while, functions, etc.
Also, I'm not sure what you'r trying to do, but that code won't do anything. It will print "Closing Gates…", wait 2 seconds and then set the variable "redset" to true.