+ -
当前位置:首页 → 问答吧 → lua里如何取得函数返回值的数量

lua里如何取得函数返回值的数量

时间:2011-02-16

来源:互联网

lua里如何取得函数返回值的数量,返回多个参数的有办法偏历吗?

作者: zlc53   发布时间: 2011-02-16

可以把返回值放到table里,然后table.getn。
Python code
> function f() return 1, 2, 3 end
> = table.getn{f()}
3

作者: iambic   发布时间: 2011-02-16