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
精彩评论