lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


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.