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

I'M having a problem with a code

Started by Saxguy99, 02 April 2013 - 07:36 AM
Saxguy99 #1
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!
theoriginalbit #2
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…
Saxguy99 #3
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
theoriginalbit #4
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…
Saxguy99 #5
Posted 02 April 2013 - 10:13 AM
Thanks that helps alot
Lyqyd #6
Posted 02 April 2013 - 10:47 AM
Moved to Ask a Pro.