【求助】请教个变量递增的问题
我定义了 test001-test100 一共100个变量能不能通过for while 等循环把所有的变量的值都显示出来
2022-03-21 01:03
程序代码:
test001='变量test001的值'
test002='变量test002的值'
test003='变量test003的值'
for i=1,3,1 do
v=string.format('test%03d',i)
print(v,'=',_G[v])
end
程序代码:Microsoft Windows [版本 10.0.19043.1766] (c) Microsoft Corporation。保留所有权利。 i:\Temp\exp>a.lua test001 = 变量test001的值 test002 = 变量test002的值 test003 = 变量test003的值
2023-01-13 10:11