lua 根据函数名字符串来执行函数

function myfunction(msg)
    print("this is msg fun " .. msg);
end

local fun =_G["myfunction"];
if fun then
    fun("is ok");
end

 

posted @ 2014-05-08 15:35  莫压枯枯地  阅读(3307)  评论(1编辑  收藏  举报