PC Review


Reply
Thread Tools Rating: Thread Rating: 1 votes, 5.00 average.

Upgrading File I/O from VB6 to VB .NET

 
 
Lisa Henkel
Guest
Posts: n/a
 
      28th Jan 2004
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
 
Reply With Quote
 
 
 
 
Patrick Steele [MVP]
Guest
Posts: n/a
 
      28th Jan 2004
In article <(E-Mail Removed)>,
(E-Mail Removed) 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
 
Reply With Quote
 
 
 
 
Herfried K. Wagner [MVP]
Guest
Posts: n/a
 
      28th Jan 2004
* (E-Mail 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', ...).

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
URGENT: Need to call VB6 DLL from C# .net application without referencing VB6 DLL csharpguy Microsoft C# .NET 4 22nd May 2006 08:06 PM
ComInterop: VB6 Com Interface object = VB6 Com object fails Douglas Marquardt Microsoft VB .NET 1 22nd Mar 2006 09:13 PM
How to Pass a form object of VB6 from .NET to VB6. pm.thirumalai@gmail.com Microsoft Dot NET 0 19th Feb 2006 01:19 PM
VB6.0 vs VB6.3 Joe Blow Microsoft Excel Programming 7 1st Jun 2004 09:50 AM
2002-2000 (or VB6.3-VB6.0) problem John Meers Microsoft Excel Discussion 1 26th Aug 2003 10:49 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:08 PM.