Upgrading File I/O from VB6 to VB .NET

L

Lisa Henkel

What kind(s) of file I/O is most portable to VB .NET? How does the
VB6 version work?

Because I'm upgrading old code, my current output statements in VB6
look like:

Print #2, Format(dTau, JDFMT)

#2 is the file, dTau is the variable, JDFMT is the format.

(I have separately declared Public Const JDFMT = " ######0.0000")

My current input statements in VB6 look like

Line Input #1, sRec

And my current open file statements look like

Open fIn For Input As #1


How will all this have to change in VB6 to be more easily ported into
VB .NET?

Or, do you suggest I immediately dive into VB.NET and then what I/O
method should I use?


Thanks.

Lisa
 
H

Herfried K. Wagner [MVP]

* (e-mail address removed) (Lisa Henkel) scripsit:
What kind(s) of file I/O is most portable to VB .NET? How does the
VB6 version work?

Because I'm upgrading old code, my current output statements in VB6
look like:

Print #2, Format(dTau, JDFMT)

#2 is the file, dTau is the variable, JDFMT is the format.

(I have separately declared Public Const JDFMT = " ######0.0000")

My current input statements in VB6 look like

Line Input #1, sRec

And my current open file statements look like

Open fIn For Input As #1


How will all this have to change in VB6 to be more easily ported into
VB .NET?

Have a look at the 'Microsoft.VisualBasic.FileSystem.File*' methods.
Nearly every VB6 file command has a "replacement" there.
Or, do you suggest I immediately dive into VB.NET and then what I/O
method should I use?

You can use the methods mentioned above or use the classes provided in
the 'System.IO' namespace ('StreamReader', 'StreamWriter', ...).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top