[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: How to specify parameters to a file chunk?
- From: "chong tsong" <tsongchong@...>
- Date: Fri, 5 Jan 2007 13:47:55 +0800
Hi, All,
As we know, loadfile() read a lua file and build a function accordingly.
Can we give the function any parameters when invoking it?
for example:
-- chunk.lua
print(arg[1])
io.flush()
-- invoke.lua
local chunk = assert(loadfile("chunk.lua"))
chunk("123") -- print "nil" rather than "123"
Does it mean we cannot pass any parameters to generated function?
Thanks a lot and best regards,
Tsong Chong