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

[Lua] Strange Error

Started by flaminsnowman99, 13 July 2012 - 05:45 PM
flaminsnowman99 #1
Posted 13 July 2012 - 07:45 PM
So I'm working on a nuclear reactor control system. And When i tested my code for it. I was getting a very strage error. The error is bios:206: [string "Reactor"]:132: "=" expected. It wants an "=" on a line that is not needed. Let me post the code.

elseif p == "2" then
    term.clear
    term.setCursorPos(1,1)
    print("What You Dont Want To See")
    sleep(2)
Line 132 is term.setCursorPos(1,1). Any ideas why thats happening?
kazagistar #2
Posted 13 July 2012 - 08:15 PM
term.clear needs to be term.clear()

To explain: term.clear is a variable that holds a function. To call a function, you have to always use ().
mister_s #3
Posted 13 July 2012 - 08:22 PM
Move term.clear and term.setCursorPos(1,1). Also, add end.

term.clear()
term.setCursorPos(1,1)
elseif p == "2" then	
print("What You Dont Want To See")	
sleep(2)
end