Job1_cfg = {
I1 = {
I11 = {
Tlist = { "TableNameList1" },
dir = "H",
typ = "B"
},
Iconn = 2,
Oconn = 1,
dir = "V",
typ = "G"
},
Jtyp = "O-TM",
dir = "V",
typ = "G"
}
而lua_objlen作用於表時,相當於Lua代碼中的#Job1_cfg,對壹個哈希表取長度,恒返回0.
要得到壹個哈希表的長度,應該要這樣:
local c = 0
for _ in pairs(Job1_cfg) do
c = c + 1
end