【发布时间】:2018-07-11 11:52:07
【问题描述】:
我是 lua 新手,我正在尝试制作一个接收文档并输出表格的函数,但我收到了上述错误。为什么??
io.write("How many documents are we evaluating? \nInput: ")
local total_documents=io.read("*n")
io.read()
local docTable = {}
inputDocument()
function inputDocument()
local input
local file
local inputFile = {filename = nil, contents = nil, wordcount = nil}
repeat
io.write("Please enter document (filename.extension): ")
input = io.read()
file =io.open(input)
if file == nil then
print("File does not exist try again")
end
until(file ~=nil)
inputFile.filename = input
return inputFile
end
【问题讨论】: