Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

TextStream question

Status
Not open for further replies.

elziko

Programmer
Nov 7, 2000
486
GB
I'm reading in a large file line by line using TextStream.ReadLine.

However, if I recieve a certain bit of data I know I can finish reading the file early (which is ~65000 lines long). At the moment I'm doing a TextStream.Readall to get to the end of the file and force TextStream.AtEndOfStream to be true enabling my loop to exit.

I'm not filling a string with this ReadAll method, so am I wasting any memory. What happens to all the data that .Read All reads when I dont set a string equal to the methods return value?

Is there a way of getting to the end of the file as quickly without wasting any memory?

Cheers,

elziko
 
Oh so simple, why didn't I think of that?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top