I'm moving to VB.NET after using VB6 for quite a few years.
File operations in VB.NET seem to have some drawbacks.
In VB6 you can use an array of anything- bytes or structures for a buffer
Buffer = String(10000," ")
Get #1, Buffer
and if the array is larger than the file it will just read in the available bytes.
But in VB.NET
FileGet(1,Buffer)
generates an error if Buffer is bigger than the available bytes.
Do you have to check the available bytes left in the file before you read from it? If so, can you tell me how?
I don't mind reading one record at a time as long as there's some internal buffering going on behind the scenes. I think that's the way C works but this method is still not as nice as VB6.
Also in VB6 you didn't have to use fixed length strings in your UDTs for easier file reading. If you read in an array of UDTs it would parse everything for you automatically. The VB.NET examples I've seen use fixed length strings. That means you have to RTrim your strings when displaying them to the user and in Combo/Listboxes etc..
I know it's basic question but this is an area I'll be using heavily and I don't want to get on the wrong track...
File operations in VB.NET seem to have some drawbacks.
In VB6 you can use an array of anything- bytes or structures for a buffer
Buffer = String(10000," ")
Get #1, Buffer
and if the array is larger than the file it will just read in the available bytes.
But in VB.NET
FileGet(1,Buffer)
generates an error if Buffer is bigger than the available bytes.
Do you have to check the available bytes left in the file before you read from it? If so, can you tell me how?
I don't mind reading one record at a time as long as there's some internal buffering going on behind the scenes. I think that's the way C works but this method is still not as nice as VB6.
Also in VB6 you didn't have to use fixed length strings in your UDTs for easier file reading. If you read in an array of UDTs it would parse everything for you automatically. The VB.NET examples I've seen use fixed length strings. That means you have to RTrim your strings when displaying them to the user and in Combo/Listboxes etc..
I know it's basic question but this is an area I'll be using heavily and I don't want to get on the wrong track...