Newbie to .net

  • Thread starter Thread starter Baba The Hut
  • Start date Start date
B

Baba The Hut

Guest
Greetings . . .

I'm a bit of a dinosaur, I guess: I've been coding in VB6 for quite a few years, and finally decided to move into the realm of .NET, by way of VB2005 Express.

When attempting to "upgrade" a rather extensive VB6 program to VB2005, most things passed through smoothly, after making some small adjustments to my code.

Where I'm getting lost is in the area of file input/output operations. My program functioned flawlessly when compiled under VB6, so the problems are not in the original code, as written.

The scenarios are as follows:

** User_Defined_Type, FileName, and other major variables, are Public Declares.
Byte-sized variables are declared locally, as needed.

** I'm using the Common Dialog Control 6.0 (SP6) - ComDlg32.ocx to choose file(s)

** I'm using Binary mode, due to the requirement of needing to read and write elements from specific locations, both as single bytes, and as user defined types.

First code snippet

Open FileName for Binary as #1
Seek #1, SomeLocation
Put #1, User_Defined_Type
Close #1

or second code snippet

Open FileName for Binary as #1
Seek #1, SomeLocation
Get #1, User_Defined_Type
Close #1

Last, but not least, the third code snippet

Open FileName for Binary as #1
For n = 1 to some_value
Get (or Put) #1, another_value
Next n
Close #1

Any help in translating would be greatly appreciated. Please keep it as simple as possible, as I still think in VB6..

Thanks and Cheers.

Baba The Hut

Continue reading...
 
Back
Top