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

'then' expected

Started by Sewbacca, 17 July 2016 - 03:19 PM
Sewbacca #1
Posted 17 July 2016 - 05:19 PM

	 elseif frame.visible then
	    if frame.xPos + frame.width - 1 >= self.xPos and
	    frame.xPos <= self.xPos + self.width - 1 and
	    frame.yPos + frame.height - 1 >= self.yPos and
	    frame yPos <= self.yPos + self.height - 1 then -- 'then' expected

I know, that is a common error, but I couldn't find any mistake. Do you see it?

Lyqyd said:
'then' expected

Look at the line the error is on and the line above it. This error usually means that your conditional expression for your if statement is malformed (or that you're actually missing your `then`). Make sure you're using the comparison operator (==) instead of the assignment operator (=) if you're checking for equality.
Dog #2
Posted 17 July 2016 - 05:37 PM
on the last line line you have frame(space)yPos instead of frame(dot)yPos
Sewbacca #3
Posted 17 July 2016 - 05:42 PM
on the last line line you have frame(space)yPos instead of frame(dot)yPos

Ohhh, thanks!!!