Results 1 to 3 of 3

Thread: simple "open c:\myfile.txt"

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jun 2000
    Posts
    537

    Question

    This code works great but could someone explain what the line 'Line Input#1,strTemp' means? or what it does exactly?
    I understand the rest of the code but not that line.
    Thanks

    Dim strTemp As String
    Open "C:\txt.txt" For Input As #1
    Do Until EOF(1) = True
    Line Input #1, strTemp '---------this line here!!!
    If Text1.Text = "" Then
    Text1.Text = strTemp
    Else
    Text1.Text = Text1.Text & vbCrLf & strTemp
    End If
    Loop
    Close #1
    pnj

  2. #2
    Guest
    Line Input reads a line from the file and places it in a variable. In this case it's strTemp.

  3. #3
    Addicted Member Jakys's Avatar
    Join Date
    Dec 1999
    Location
    Norway
    Posts
    180
    Do Until EOF(1) = True (this line takes the next line into a loop until End Of File=true.(1) is the file (Open "C:\txt.txt" For Input As #1))

    Line Input #1, strTemp (here the program reads one and one line from #1 and stores it in strTemp)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width