lua怎样将表tabB中的值赋给表tabA值
localtabA={name="ceshi",age=0,areg="北京市"}localtabB={"wangjiajun",32,"深圳市"}最后变成{name="...
local tabA = {name = "ceshi" , age = 0, areg = "北京市"}
local tabB = {"wangjiajun", 32, "深圳市"}
最后变成{name = "wangjiajun" , age = 32, areg = "深圳市"}这样 展开
local tabB = {"wangjiajun", 32, "深圳市"}
最后变成{name = "wangjiajun" , age = 32, areg = "深圳市"}这样 展开
1个回答
展开全部
tabA.name = tabB[1];
tabA.age = tabB[2];
tabA.areg= tabB[3];
tabA.age = tabB[2];
tabA.areg= tabB[3];
更多追问追答
追问
tabA = {{name = "ceshi" , age = 0, areg = "北京市"},{name1 = "aaaa" , age1 = 0, areg1 = "深圳市"}}
tabB = {"lishi",23,"深圳市","wangwu",40,"上海市"}
追答
tabA[[1].name = tabB[1];
tabA[1].age = tabB[2];
tabA[1].areg= tabB[3];
tabA[2].name = tabB[4];
tabA[2].age = tabB[5];
tabA[2].areg= tabB[6];
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询