attempt to index local ‘file’ (a nil value)可以打印出错误来分析

attempt to index local ‘file’ (a nil value)可以打印出错误来分析

A = "Hello"
local file, err = io.open ('test.txt',"w")
if file==nil then
    print("Couldn't open file: "..err)
else
    file:write(A)
    file:close()
end

发表评论

电子邮件地址不会被公开。 必填项已用*标注