开发者

Multiple locals on one line?

开发者 https://www.devze.com 2023-01-05 19:23 出处:网络
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 ni

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

精彩评论

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