lua 加载table文件

temp.lua

info = {
    textures="testui0.plist",
    designHeight=510,
    designWidth=450,
    widgetTree={
    classname="Panel",
    }
}

加载temp.lua

> = t
nil
> t = assert(loadfile("temp.lua"))
> = t
function: 0x8006b530
> = info
nil
> t()                                       -- 关键就在这里
> = info
table: 0x8005ab48
> = info["designHeight"]
510

具体原因还不清楚

转载于:https://www.cnblogs.com/tingliang/archive/2013/06/13/lua.html

你可能感兴趣的:(lua 加载table文件)