Forum Discussion
kbenson
16 years agoVisitor
The "then" of an if statement is optional, so that has no bearing. I was referring to the msg variable holding an invalid values, so something like this may be required:
msg = wait(0, screen.GetMessagePort())
if msg<>invalid then
if msg.isScreenClosed() then
print "Screen closed"
exit while
else if msg.isButtonPressed()
... do something ...
end if
end if