Results 1 to 4 of 4

Thread: Open a File and Looping [Resolved]

Threaded View

  1. #1

    Thread Starter
    Frenzied Member Ideas Man's Avatar
    Join Date
    Aug 2002
    Location
    Australia
    Posts
    1,718

    Open a File and Looping [Resolved]

    OK, I know how to get the data out of a file and how to loop to get more than one line. The problem is if the file contains a blank line, my loop stops without continuing. I'm not sure if VB6 had this problem but it is really annoying. I'd also like a .NET answer too please, not an old unmanaged answer if that's what it's called.

    VB Code:
    1. Do While Data <> Nothing 'Problem
    2.     Data = sReader.ReadLine
    3.     ListBox1.Items.Add(Data)
    4. Loop
    Last edited by Ideas Man; Mar 20th, 2004 at 07:56 AM.
    I use Microsoft Visual Basic 2005. (Therefore, most code samples I provide will be based around the .NET Framework v2.0, unless otherwise specified)

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