error_desc [result] 这样用对么
check.luafunction check (result)
if result ~= error_code.eOK then
error (error_desc or
string.format ("Unknown error code: %i", result),
2) -- error level - whoever called this function
end -- if
end -- function check
return check
红字部分用法可对? error_code ,error_desc在check.lua里都没有定义,
这两个是怎么个意思呢 http://www.gammon.com.au/scripts/doc.php?general=errors
这些我理解
我想问 error_code和error_desc是默认的表还是自定义的表,还是别的什么
[ 本帖最后由 ssb 于 2010-4-24 05:44 PM 编辑 ] The "error_desc" table is automatically supplied by MUSHclient for Lua scripts. I wasn't sure whether I could access error_code and the others without importing constants.lua first (which is really wrapped by XML). Now I see error_code is an entirely separate table, and it seems that I can access it, so thank you for letting me know!
error_code也找到了
多谢ddid了!
[ 本帖最后由 ssb 于 2010-4-24 07:32 PM 编辑 ] nothank
页:
[1]