[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: load config file into table
- From: Pierre-Yves Gérardy <pygy79@...>
- Date: Mon, 18 Jul 2011 22:01:00 +0200
You forgot to call the config_function. loadfile() compiles the
script, but does not run it.
> config ={}
> function load_config()
> local config_file_name = gre.SCRIPT_ROOT .. "/../runtime_config.txt"
> local config_function = assert(loadfile(config_file_name))
> setfenv(config_function, config)
+ config_function()
> dump_table(config)
> end
Regards,
-- Pierre-Yves