Question Locked

VB.Net readline question

0 helpful
4 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
I am using readline to read in lines from a text file and place them in a text box with the append method. This process is skipping the first line of text in the file and also it is not putting the last line in the textbox fully intact. The last line starts with an ampersand and the ampersand is being placed at the end of the previous record placed in the text box. Could someone advise? Thanks DC

4 replies

by tony hopkinson

without seeing the code and the file
Why are you reading it line by line anyway?
StreamReader.ReadToEnd() would just give you the lot, as long as it's poistioned at the start...

by slayer_

dim sText as string
dim sCompText as string
dim iFile as integer
iFile = freefile
open "C:\test.txt" for input as freefile
do until eof(iFile)
line input iFile, sText
sCompText = sCompText & sText
loop
textbox1.text=sCompText

Your one line of code required between 300mb and 2 gigs of support files, mine required 2 megs of support files :p

This discussion is closed to new replies.