[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: [5.1.4/newbie] How to check end script?
- From: Gilles Ganault <gilles.ganault@...>
- Date: Mon, 07 Mar 2011 10:40:45 +0100
Hello
I have a newbie question for which Google didn't really help.
I need to exit a script in case the user forgot to pass a parameter,
and noticed that return works in the "if" block but doesn't when used
in the main loop:
==============
if arg[1] == nil then
print("Argument missing")
-- why does this work?
return
else
print("OK")
end
print("here")
-- why does "return" not work?
-- " '<eof>' expected near '=' "
-- return
if true then return end
print("after return")
==============
Why is that?
Thank you for your help.