Results 1 to 22 of 22

Thread: Reading File into an array [RESOLVED, and then some]

Threaded View

  1. #1

    Thread Starter
    Lively Member Cagez's Avatar
    Join Date
    Oct 2002
    Posts
    121

    Cool Reading File into an array [RESOLVED, and then some]

    I've opened the file successfully and put it into a textbox, but now I want to do separate lines... I've come up with this but it always makes an error...

    VB Code:
    1. opnFile.ShowDialog()
    2.         fn = opnFile.FileName ' file name
    3.         sr = File.OpenText(fn) ' my stream reader
    4.  
    5.         Dim x() As String
    6.         While sr.Peek <> -1
    7.             x(x.Length + 1) = sr.ReadLine()
    8.         End While
    9.  
    10.         txtDisplay.Lines = x
    11.         sr.Close()
    Last edited by Cagez; Mar 5th, 2003 at 02:20 PM.

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