By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,719 Members | 1,036 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,719 IT Pros & Developers. It's quick & easy.

Reading text from file using ReadLine method

P: n/a
CD
Hi,

I am getting a problem using the following piece of code:

Dim strfile As Object
Set strfile = FSO.OpenTextFile(stFilePath, 1)
Do While Not strfile.AtEndOfStream
strtext = strfile.ReadLine
Loop

Whenever the character count of the line goes in excess of 130, only the
131st character onwards are displayed. Any pointers?

CD
Nov 21 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
This snippet of code is completely late bound and is using the old Scripting
Runtime Library methods to read the file. You should use the objects
provided in the System.IO namespace if you are programming with .Net. Take
a look at the StreamReader object.

--Robby

"CD" <CD@discussions.microsoft.com> wrote in message
news:DC**********************************@microsof t.com...
Hi,

I am getting a problem using the following piece of code:

Dim strfile As Object
Set strfile = FSO.OpenTextFile(stFilePath, 1)
Do While Not strfile.AtEndOfStream
strtext = strfile.ReadLine
Loop

Whenever the character count of the line goes in excess of 130, only the
131st character onwards are displayed. Any pointers?

CD

Nov 21 '05 #2

P: n/a
CD
Hi,
Thanks for the advice but i am programming in VB6.0 and not in .NET, so
unfortunately i cannot use the methods in System.IO namespace.
I would be happy if you could let me know if the ReadLine method
encounters some problem when the length of the line is more than 131 chars
and how i can overcome it.

Thanks
CD
Nov 21 '05 #3

P: n/a
CD,

This is a VBNet newsgroup.
Although the the name is as well VB it has almost completly different code.

For VB classic there are a lot of newsgroups.

microsoft.public.vb*

The most active is as far as I know

microsoft.public.vb.generaldiscussions.

I hope this helps?

Cor

"CD" <CD@discussions.microsoft.com>
Hi,
Thanks for the advice but i am programming in VB6.0 and not in .NET,
so
unfortunately i cannot use the methods in System.IO namespace.
I would be happy if you could let me know if the ReadLine method
encounters some problem when the length of the line is more than 131 chars
and how i can overcome it.

Thanks
CD

Nov 21 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.