初学lua,---问题出在哪?lua:tabledemo.lua:25:--attempt to index globa
来源:学生作业帮 编辑:搜搜考试网作业帮 分类:综合作业 时间:2024/05/16 03:26:46
初学lua,---问题出在哪?lua:tabledemo.lua:25:--attempt to index global 'a' (a number value)
源代码是这样的:
a={}-- empty table-- create 1000 new entries
for i=1,1000
do a=i*2
end
print(a[9])
在editplus中运行的就出现了lua:tabledemo.lua:25:--attempt to index global 'a' (a number value)错误
源代码是这样的:
a={}-- empty table-- create 1000 new entries
for i=1,1000
do a=i*2
end
print(a[9])
在editplus中运行的就出现了lua:tabledemo.lua:25:--attempt to index global 'a' (a number value)错误
首先说一下 你的排版不是很好 这样写会好点
a={}-- empty table-- create 1000 new entries
for i=1,1000 do
a=i*2
end
print(a[9])
在运行到 a=i*2这个语句的时候 你的a 就不再是table 而是一个number了
所以把 a=i*2 改成 a[i]=i*2 就好了
a={}-- empty table-- create 1000 new entries
for i=1,1000 do
a=i*2
end
print(a[9])
在运行到 a=i*2这个语句的时候 你的a 就不再是table 而是一个number了
所以把 a=i*2 改成 a[i]=i*2 就好了
LUA写出文件问题 出现attempt to index global 'io' (a nil value)
lua环境变量问题.我的环境变量LUA_PATH为";;C:\Program Files\Lua\5.1\lua\?.l
window7 删除VM-ware 是出现 Unable to find the file bootstrap.lua
求大神写一个太阳神三国杀的lua
lua 不重复随机数算法 比如1-7 取7次 每次不能重复
英语单选和填空“there is __ with your son”,said mrs LuA.nothing seri
英语翻译A ngj e la caj j.a ngj e la 1 ng tham lam lua ah de lay
求用LUA建一个颜色取值表,可以通过改变一个外设的变量取值不同而选择不同的颜色.
attempt to be sth 还是 attempt sth
The attempt to connect timed
attempt to do 和attempt doing 的区别?
attempt 既然是及物动词为什么能attempt to do