Open TxtPath.Text For Input As #F1
i = 1
Do While Not EOF(F1)
Line Input #F1, INPUTVAR1
If Trim(StrMid(INPUTVAR1, 1, 7)) <> "VERSION" Then
Else
Open "c:\error_pb.txt" For Output As #1
Print #1, INPUTVAR1;
Next i
Close #1
End If
i = i + 1
Me.Label1.Caption = i
Loop
Close #F1当我运行到 Open "c:\error_pb.txt" For Output As #1 的时候
总是提示我文件已经打开
i = 1
Do While Not EOF(F1)
Line Input #F1, INPUTVAR1
If Trim(StrMid(INPUTVAR1, 1, 7)) <> "VERSION" Then
Else
Open "c:\error_pb.txt" For Output As #1
Print #1, INPUTVAR1;
Next i
Close #1
End If
i = i + 1
Me.Label1.Caption = i
Loop
Close #F1当我运行到 Open "c:\error_pb.txt" For Output As #1 的时候
总是提示我文件已经打开
i = 1
Do While Not EOF(F1)
Line Input #F1, INPUTVAR1
If Trim(StrMid(INPUTVAR1, 1, 7)) <> "VERSION" Then
Else
F2 = freefile()
Open "c:\error_pb.txt" For Output As #F2
Print #F2, INPUTVAR1;
Next i
Close #F2
End If
i = i + 1
Me.Label1.Caption = i
Loop
Close #F1
如:
Open "C:\text1.txt" For Binary #1
Open "C:\text2.txt" For Binary #2
Open "C:'text3.txt" For Binary #3
Open "C:'text4.txt" For Binary #4
Open "C:'text5.txt" For Binary #5
...Get #1,1,data1
Put #2,1,data1
Put #3,1,data1
Put #4,1,data1
Put #5,1,data1
...Close #1
Close #2
Close #3
Close #4
Close #5
...
生成文件号用: freefile()
完毕后关闭文件.
文件号又不能有负数,所以只有32767个文件。
在 Open 语句中用来打开文件的号码。对不能访问其它应用程序的文件,使用1–255 范围内的文件号,对可由其它应用程序访问的文件,使用256–511 范围内的文件号