一个文本文件
里面是一行行的数据
我用一个循环来对每一行数据进行读取和处理
但我怎么判断什么时候读完了
即循环条件怎么写
象记录集可以用Do while rs.EOF 文件怎么做
DO WHILE 条件
end loop

解决方案 »

  1.   

    Dim TextLine
    Open "TESTFILE" For Input As #1   ' 打开文件。
    Do While Not EOF(1)   ' 循环至文件尾。
       Line Input #1, TextLine   ' 读入一行数据并将其赋予某变量。
       Debug.Print TextLine   ' 在立即窗口中显示数据。
    Loop
    Close #1   ' 关闭文件。
      

  2.   

    Dim strS As String
            Open "f:\d.txt" For Binary As 1
            strS = String(FileLen("f:\d.txt"), " ")
            Get #1, , strS
            Close #1    temp = Split(strS, vbCrLf)
        string1 = temp(0)
        string2 = temp(1)