473,396 Members | 1,875 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Upgrading File I/O from VB6 to VB .NET

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
Nov 20 '05 #1
2 1425
In article <43**************************@posting.google.com >,
li********@monad.net says...
What kind(s) of file I/O is most portable to VB .NET? How does the
VB6 version work?


You can see how these constructs are used in .NET at this MSDN like:

http://tinyurl.com/2yy4s

--
Patrick Steele
Microsoft .NET MVP
http://weblogs.asp.net/psteele
Nov 20 '05 #2
* li********@monad.net (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', ...).

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: frr | last post by:
Hi, After upgrading to 2.4 (from 2.3), I'm getting a weird syntax error: >>> import themes Traceback (most recent call last): File "<interactive input>", line 1, in ? File "themes.py", line...
5
by: Mike Owen | last post by:
Hi, I have just used the import Wizard to import a VS 2003 app to VS 2005. I have a lot of work to do to enable it to compile successfully with all the errors and warnings it gave me, but as a...
13
by: Noesis Strategy | last post by:
When I ordered my new laptop, Sony didn't offer Access 2003 in its bundles. Recently, I have begun to design Access databases using an copy of Access 2002 from my previous laptop. It works fine,...
11
by: Aidan Tobin | last post by:
Hi, I have to upgrade a number of databases from Access 2.0, Access 97 and Access 2000 to work in Office 2003. These databases contain a number of Forms coded with VBA as well as a number of...
4
by: james | last post by:
I upgraded my 2002 project to 2003 and I am getting several of there errors on my forms xxxForm.resx Resource transformation for file 'xxxForm.resx' failed. Possible Version mismatch. Type...
4
by: Spurry Moses | last post by:
I know it's in Beta 2, but I can't report any good experiences with upgrading a project form 2003 to 2005. I tried to upgrade a 2003 project to C# Express 2005. My application has hardly...
2
by: Oleg | last post by:
Dear All, I have upgraded Postgresql from 7.3 to 7.4. Starting pg brings error: The database is in an older format that cannot be read by version 7.4 of PostgreSQL dpkg-upgrade postgresql...
15
by: Asaf | last post by:
Hi, I have received a source code project written in C++ VS.NET 2003 on .NET 1.1 that compiles without a problem. I have opened this source code in VS.NET 2005 and the Log wizard says that...
0
by: Ben Fidge | last post by:
Since upgrading to ASP.NET 2.0 I've been getting a lot of errors about a file called WebResource.axd but can't find this file and have never heard of it. Anyone know why all of a sudden the...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.