有人可以解释为什么当我删除该行时 io.write 不起作用
io.write(inshort.."\n")?
io.output 没有第二个定义。代码是否过于嵌套并且 io.output 在某些状态下无效?
我知道 doSomething 被正确调用...
function findpos(arg0, arg1,argf)
io.input(arg0)
io.output("that.txt")
posicounter =0
posibuffer=""
if not arg0 then return 99 end
counter = 1
while true do
local line = io.read("*line")
if line == nil then break end
for k, searchstring in ipairs(arg1) do
found = string.find(line, searchstring)
if found ~=nil then
inshort = string.sub(line, found)
io.write(inshort.."\n")
if(inshort==posibuffer) then
posicounter=posicounter+1
elseif posicounter >0 then
io.write("before")
node = doSomething()
io.write("after")
posicounter=0
else
posicounter=0
posibuffer=inshort
end
end
argf(timestamp, string.sub(line, 24))
counter = counter +1
end
end