编写自己程序的调试日志出现错误
程序代码:
On Error Resume Next Open (App.Path & "\ErrLog\RunTimeLog.log") For Input As #1 Input #1, Tag4 Close #1 If Tag4 <> "" Then Tag5 = Tag4 & vbCrLf & Now & " ShutDown After " & Str(Tag1) & " Second" Else Tag5 = Now & " ShutDown After " & Str(Tag1) & " Second" End If Open (App.Path & "\ErrLog\RunTimeLog.log") For Output As #1 Print #1, Tag5 Close #1
该段代码本意为每次对Log文件增加一行文字
但是结果却是,最终只会有两行文字
怎么回事?