Results 1 to 3 of 3

Thread: "line input" isn't working here - ideas?

  1. #1

    Thread Starter
    Frenzied Member wengang's Avatar
    Join Date
    Mar 2000
    Location
    Beijing, China
    Posts
    1,604
    I'm trying to copy this file , line by line, and assign it to a string array, but there seem to be no carriage returns in the text, so VB only inputs the first line. The file is system.1st on C:\. I know everybody has this file, so could somebody look at this?

    intCount = 0
    Open "C:\system.1st" For Input As #1
    Do Until EOF(1) = True
    intCount = intCount + 1
    Line Input #1, strData(intCount)
    Loop
    intNumLines = intCount
    Print intNumLines
    Print Len(strData(1))

    intNumLines prints as 1
    Len for this line prints (in my case) 142, which is the number of characters in the first line. Anybody know why or, better yet, how to get everybit of this code into my string array?

    thanks
    Wen Gang, Programmer
    VB6, QB, HTML, ASP, VBScript, Visual C++, Java

  2. #2
    Lively Member Kersey's Avatar
    Join Date
    Jun 1999
    Location
    The Netherlands
    Posts
    101
    you might try this :

    Code:
    Open FileName For Binary Access Read As #1 'open file text1(0)
    indata = Input(LOF(1), 1)
       'Debug.Print Len(code)
    Close #1

  3. #3

    Thread Starter
    Frenzied Member wengang's Avatar
    Join Date
    Mar 2000
    Location
    Beijing, China
    Posts
    1,604
    Kersey,
    that was it.
    and i do appreciate it.

    Wen Gang, Programmer
    VB6, QB, HTML, ASP, VBScript, Visual C++, Java

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