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

How To Define A While Statement With 2 Conditions?

Started by pcmaster160, 26 February 2012 - 08:08 PM
pcmaster160 #1
Posted 26 February 2012 - 09:08 PM
while (isSpace()==true) and (turtle.getItemCount(9)>1) do

So I'm doing something wrong with the bracketing. Error is "end" expected to close while. The end comes 5 or so lines down so it is thinking there should be a end before the and statement.
Liraal #2
Posted 26 February 2012 - 09:12 PM
it should be just

while isSpace()==true and turtle.getItemCount(9)>1 do
MysticT #3
Posted 26 February 2012 - 09:13 PM
I don't see any error. Post the rest of the code, maybe it's in another line.
pcmaster160 #4
Posted 26 February 2012 - 09:22 PM
well first off I had the complete wrong function I was calling. And second I wasn't calling it right. But checked with the api again and im good now and its working :D/>/>