[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: dofile
- From: "Aaron Brown" <aaron-lua@...>
- Date: Fri, 15 Jul 2005 10:00:29 -0400
David B:
> dofile() does not pass parameters to the chunk as Luiz
> points out.
Roberto:
> As he pointed out, use loadfile in that case.
Only in 5.1, though, right? In 5.0 you have to have a
function within the loadfile'd file that takes arguments.
For instance:
-- (No error checking.)
local filefunc = loadfile("loadfilefile.lua")
local returnedfunc = filefunc()
local result = returnedfunc(arg1, arg2, arg3)
--
Aaron