36 posts
Posted 02 April 2013 - 09:36 AM
hi im have a problem with the code
term.setCursorPos(1,1)
It keeps telling me i need an =
it says
'=' expected
so can anyone help me please!
7508 posts
Location
Australia
Posted 02 April 2013 - 09:41 AM
for future reference the "programs" section is for completed programs and their code… this should have been in "Ask a Pro"
in anycase. there is nothing wrong with that instruction. seems like you have something else wrong. please post your code and the exact error message so that we can assist better…
36 posts
Posted 02 April 2013 - 09:50 AM
print ("lights on or off")
input = read()
if input == "on" then
redstone.setOutput("back", true)
term.clear
term.setCursorPos(1,1)
elseif input == "off" then
redstone.setOutput("back", false)
term.clear
term.setCursorPos(1,1)
else
print ("Not a Valid Answer.")
sleep(3)
term.clear
term.setCursorPos(1,1)
Thats the code
and the error code is bios:337: [string "lights"]:10: '=' expected
7508 posts
Location
Australia
Posted 02 April 2013 - 09:51 AM
the term.clear requires () at the end. that is why it wanted an = sign… it was expecting you to set the term.clear to something, instead of attempting to call it…
36 posts
Posted 02 April 2013 - 10:13 AM
Thanks that helps alot
8543 posts
Posted 02 April 2013 - 10:47 AM
Moved to Ask a Pro.