开发者

Multiple locals on one line?

Consider the following Lua code:

local var1, 开发者_运维百科var2;

Is var2 a local variable here? Or is only var1 a local?


Both are local.


Both variables are local, and both are given a value of nil.

To assign them to 2 different values, simply:

local var1,var2 = 1,2
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜