如何在shortdesc中使用title? 以下方法会失败: function descriptor() return { title = "This"; shortdesc = title .. " is my text." } end
您不能这样做;但是您可以使用本地变量:function descriptor() local title = "This" return { title = title; shortdesc = title .. " is my text." } end
保罗是正确的。你也可以分段构建表格: function descriptor() local t = {} t.title = "This"; t.shortdesc = t.title .. " is my text." return t end