[Freeswitch-users] LUA - Call a Function through a variable name

Chad Phillips chad at apartmentlines.com
Mon Dec 17 06:55:24 MSK 2012


Lua 5.1.4  Copyright (C) 1994-2008 Lua.org, PUC-Rio
> function foo() print "hello" end
> bar = foo
> bar()
hello
> 

or, if you really want to have the function name as a string, there are some suggestions here:

http://stackoverflow.com/questions/1791234/lua-call-function-from-a-string-with-function-name

hunmonk 


On Sunday, December 16, 2012 at 11:34 AM, Lloyd Aloysius wrote:

> Hello 
> 
> Does lua support , Call a Function through a variable name
> 
> Ex:
> 
> function playfile()
> 
> end
> 
> variable_a = "playfile" 
> 
> how to call the variable_a , that execute function? 
> 
> Thanks
> Lloyd
> 
> 
> 
> _________________________________________________________________________
> Professional FreeSWITCH Consulting Services:
> consulting at freeswitch.org (mailto:consulting at freeswitch.org)
> http://www.freeswitchsolutions.com
> 
> 
> 
> 
> Official FreeSWITCH Sites
> http://www.freeswitch.org
> http://wiki.freeswitch.org
> http://www.cluecon.com
> 
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org (mailto:FreeSWITCH-users at lists.freeswitch.org)
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org
> 
> 


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20121216/a35eeb0d/attachment.html 


Join us at ClueCon 2011 Aug 9-11, 2011
More information about the FreeSWITCH-users mailing list