[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: FEtching individual funmctions from modules
- From: "Jérôme Vuarand" <jerome.vuarand@...>
- Date: Sun, 29 Jul 2007 22:44:37 -0400
2007/7/29, Luiz Henrique de Figueiredo <lhf@tecgraf.puc-rio.br>:
> > I would like to call the OnEvent() function of all loaded modules at a
> > given time.
>
> for k,v in pairs(_G) do
> if type(v)=="table" and type(v.OnEvent)=="function" then
> v.OnEvent()
> end
> end
>
> Change _G to something else if can keep track of all loaded modules.
You can use package.loaded instead of _G if you use standard modules.