[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Evaluating files...
- From: Wim Couwenberg <w.couwenberg@...>
- Date: Tue, 26 Jul 2005 08:19:35 +0200
> ...Is it
> possible to evaluate a file before attempting to run it (such as the -c
> argument with perl)? In other words, can I check that it is
> syntactically correct in any way other than actual execution of the
> code.
Try:
local chunk, err = loadfile("myfile.lua")
if chunk then
print("All's well")
else
print("error in file: " .. err)
end
--
Wim