Results 1 to 4 of 4

Thread: How to read in one line of a file

  1. #1

    Thread Starter
    Member
    Join Date
    Jun 2002
    Posts
    44

    How to read in one line of a file

    Can someone tell me the syntax to read in one line of a file?
    Tks

  2. #2
    Addicted Member E-Link's Avatar
    Join Date
    Nov 2001
    Location
    INA
    Posts
    242
    VB Code:
    1. Open "C:\Myfile.TXT" For Input As #1
    2. Line Input #1, StrTemp
    3. Close #1
    4. msgbox StrTemp

  3. #3
    Member
    Join Date
    Jul 2002
    Location
    china(ÖØÇì)
    Posts
    60

    it can use vbcode down

    dim astring() as string,i as long
    Open "C:\Myfile.TXT" For Input As #1
    do while not eof(1)
    Line Input #1, StrTemp
    i=i+1
    redim preseve astring(i)
    astring(i)=strtemp
    Close #1
    msgbox StrTemp
    I am a vb fine,
    but my English was poor.

  4. #4

    Thread Starter
    Member
    Join Date
    Jun 2002
    Posts
    44

    Re: it can use vbcode down

    [QUOTE]Originally posted by qflash
    dim astring() as string,i as long
    Open "C:\Myfile.TXT" For Input As #1
    do while not eof(1)
    Line Input #1, StrTemp
    i=i+1
    redim preseve astring(i)
    astring(i)=strtemp
    Close #1
    msgbox StrTemp
    [/QUO

    Thank you

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