android中一种不支持的lua操作

来源:互联网 发布:mysql修改字段名 编辑:程序博客网 时间:2024/06/05 20:08

今天写了一段lua代码,在win32中正常运行,在android中运行无效。

大概是这样的:

------file1.lua-----

local t = {}

t.str = "this is file1.t"

return t

----------------------


-----file2.lua------

local t = require "file1"

print(t.str)

----------------------

所以没办法,只好这样修改:

------file1.lua-----

local t = {}

t.str = "this is file1.t"

_G.t = t

----------------------


-----file2.lua------

require "file1"

print(t.str)

----------------------

就都能运行了。