首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > 其他开发语言 >

lua 返回表有关问题

2012-02-10 
lua 返回表问题一个lua 中的某函数.会返回两个参数:一个bool,一个表如:lua中C/C++ codefunction MyFunc(sz

lua 返回表问题
一个lua 中的某函数.会返回两个参数:一个bool,一个表
如:lua中

C/C++ code
function MyFunc(szName)    local t = {}    t.Name = szName    t.Age = 10    return true, tend


在程序中调用 这个函数
Delphi(Pascal) code
  lua_getglobal(L,'MyFunc');  lua_pushstring(L, 'Name');  if (lua_pcall(L, 1, 2, 0) <> 0) then begin    lua_pop(L, 1);    exit;  end;  lua_toboolean(L,-1); //取第一个返回值  lua_pop(L, 1);  //然后这里的表该如何获得?


麻烦各位朋友贴下代码,c++或delphi都可

[解决办法]
纯jf

热点排行