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

[LUA] [ERROR] 'while' Syntax Error

Started by chobbis2, 24 June 2012 - 02:11 PM
chobbis2 #1
Posted 24 June 2012 - 04:11 PM
I was coding a simple program on a mining turtle and got this error:

bios:206: [string "railing"]:2:
'do' expected

This was my program:

while true do
    while i=1,8 do
	    turtle.forward()
	    turtle.placeDown()
    end
    turtle.forward()
    turtle.select(9)
    turtle.placeDown()
    turtle.select(1)
end

Does anyone know how to fix this? I'm fairly new to Lua so it could be a simple fix.
tfoote #2
Posted 24 June 2012 - 04:25 PM
Im pretty sure the second while should be a "for"
chobbis2 #3
Posted 24 June 2012 - 05:03 PM
:P/>/> Thx! It works now!
tfoote #4
Posted 24 June 2012 - 05:05 PM
:P/>/> Thx! It works now!
Yes! I finally answered a question!
BTW: Check out this http://computercraft.info/wiki/index.php?title=Loops