lua-users home
lua-l archive

RE: Calling function by string name

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


On 28 Jan 2003, at 19:39, Peter Prade wrote:
> > So, how do I get a "handle" to function "funcname", having
> > it's (string) name? Like:
> >
> > handle = get funcion by name ("ent_wall")
> >
> > call(handle, args) -- call global function "ent_wall"
> 
> just read it from the globals table: (all global variables are just entries
> in that table)
> 
> handle = globals()["ent_wall"]
> 
> Cheers,
> Peter
Thanks folks, now I have not one, but half a dozen ways to do it.
:-)
- Fabio
(p.s.: "javabeans"? bah. )
--
[]'s
Fábio R. Cecin
frcecin@terra.com.br

AltStyle によって変換されたページ (->オリジナル) /