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

Bios 339 error in program

Started by JaydenLoon3y, 15 March 2014 - 10:00 AM
JaydenLoon3y #1
Posted 15 March 2014 - 11:00 AM
I have just gotten back into computercraft and now I am getting errors from somewhere in my code.

The error I get is


bios:339:blah blah:8: end expected to close while at line 3

I have been looking for 20 mins now and I cant find the error


rednet.open("top")

while true do
  event,senderid,message = os.pullEvent("rednet_message")
  if message == "mach1 0" then
    redstone.setOutput("back", true)
  end
  else if message == "mach1 1" then
    redstone.setOutput("back", false)
  end
end

Thanks in advance!
CometWolf #2
Posted 15 March 2014 - 11:02 AM
There's no space in an elseif statement, it should be just "elseif" and you don't need an end to close an if followed by an elseif.
JaydenLoon3y #3
Posted 15 March 2014 - 12:52 PM
Cheers!