line input

raymond3090

Registered User.
Local time
Today, 14:45
Joined
Sep 5, 2002
Messages
43
hi there. I am trying to access the contents of a file line by line. I am using the 'line input' statement, which as I understand, is supposed to return the lines of the file sequentially. It turns out that when I use it in the following code, it actually returns much more than a single line which is useless to me! Any suggestions?


Open testFile For Input As #1
Line Input #1, strTxt
MsgBox strTxt

I end up with a message box almost the size of my screen!


thanks,

-Ray
 
If the message box is huge but mostly blank try:

MsgBox Trim(strText)

That way all unnecessary spaces will be removed.
 
unfortunately, the message box is huge, but not blank! It is filled with text, just from the strTxt variable!
 
Ray,

I would guess that the individual lines in your text file
are not terminated with CR or CR-LF. Your file is probably
one long line.

To make it useful, you will probably have to re-create it.

Wayne
 

Users who are viewing this thread

Back
Top Bottom