-
Re: Another Language
Hi Gary,
"Gary Nelson" <gn@contanet.es> wrote in message news:3b127063@news.devx.com...
>
> Any place I can pick up some sample code to try out?
>
I'll have to get back to you on that. I tried a sample that just uses Binary
forread/write and had it reading/writing a UDT with a couple of longs in it and
a fixed length string. The file got written out corectly, but I kept getting
errors when trying to read it back in. (worked fien in VB6 <g>). Anyway, so I
duga little deeper and looked at the IL for that VB class/method (FileGet(int32,
valueType)) and it loosk like they haven't implemented that code yet, at least
not in the build I have. So might have to wait till Beta 2 to try out the VB
compatibility library on thing like this.
Anyway, what it changes to is:
Open strFilePath for Binary As FileNo
becomes:
FileOpen(FileNo, strFilePath, OpenMode.Binary)
Close #FileNo
becomes:
FileClose(FileNo)
Put #FileNo, , tUDT
becomes:
FilePut(FileNo, tUDT)
etc.
oh, and the UDT:
Type myUDT
a As Long
b As Long
s As String * 16
c As Long
End Type
became:
Structure myUDT
Dim a As Integer
Dim b As Integer
<VBFixedString(16)> Dim s As String
Dim c As Integer
End Structure
as for perf, well I still don't know <g>
-
Re: Another Language
Bill,
Thanks for the info.
> I tried a sample that just uses Binary
> forread/write and had it reading/writing a UDT with a couple of longs in
it and
> a fixed length string. The file got written out corectly, but I kept
getting
> errors when trying to read it back in. (worked fien in VB6 <g>). Anyway,
so I
> duga little deeper and looked at the IL for that VB class/method
(FileGet(int32,
> valueType)) and it loosk like they haven't implemented that code yet, at
least
> not in the build I have. So might have to wait till Beta 2 to try out the
VB
> compatibility library on thing like this.
I got the following answer from Dave Mendlen, Lead Product Manager of Visual
Studio.NET:
"Structures with fixed-length strings weren't completely working in Beta1.
When Beta2 comes out, you should be able to attribute the fixed-length
strings in your structures so that Len gets an accurate measurement and Get
can read in a fixed-length record."
So, as of yet there is no binary access. The question is: Will it work in
Beta2? Will have to wait and see.
Gary
-
Re: Another Language
"Gary Nelson" <gn@contanet.es> wrote in message
news:3b1600be$1@news.devx.com...
> I got the following answer from Dave Mendlen, Lead Product Manager of
Visual
> Studio.NET:
>
> "Structures with fixed-length strings weren't completely working in Beta1.
> When Beta2 comes out, you should be able to attribute the fixed-length
> strings in your structures so that Len gets an accurate measurement and
Get
> can read in a fixed-length record."
>
> So, as of yet there is no binary access. The question is: Will it work in
> Beta2? Will have to wait and see.
The real question is can VB.NET be released without a solution that works
for binary file access?.
Since the answer is NO, I'd say you have nothing to worry about.
Kunle
-
Re: Another Language
Hi Gary,
"Gary Nelson" <gn@contanet.es> wrote in message news:3b1600be$1@news.devx.com...
> Bill,
>
> Thanks for the info.
>
you're welcome
>
> I got the following answer from Dave Mendlen, Lead Product Manager of Visual
> Studio.NET:
>
> "Structures with fixed-length strings weren't completely working in Beta1.
> When Beta2 comes out, you should be able to attribute the fixed-length
> strings in your structures so that Len gets an accurate measurement and Get
> can read in a fixed-length record."
>
There will be a VBFixedString attribute, but be aware that it will be limited in
it's useage and also don't expect the same performance as VB6 fixed length
strings. And as this is an attribute, you won't be able to use it on local vars
only on fields.
> So, as of yet there is no binary access. The question is: Will it work in
> Beta2? Will have to wait and see.
>
There will be some, as in for many cases there will be somethign the migration
wizard can change that VB6 code to. However it will not be anywhere near as
efficient as VB6 code. Also there are changes such as Structures (UDT's) cannot
have pre-declared array initialisers in them, so you will need to specify a
constructor for the structure and marshalling attributes on arrays.
-
Re: Another Language
Bill,
> There will be some, as in for many cases there will be somethign the
migration
> wizard can change that VB6 code to. However it will not be anywhere near
as
> efficient as VB6 code. Also there are changes such as Structures (UDT's)
cannot
> have pre-declared array initialisers in them, so you will need to specify
a
> constructor for the structure and marshalling attributes on arrays.
That doesn't sound very nice.
Gary
-
Re: Another Language
On Thu, 31 May 2001 13:17:30 +0100, "Kunle Odutola"
<kunle.odutola@<REMOVETHIS>okocha.freeserve.co.uk> wrote:
>
>The real question is can VB.NET be released without a solution that works
>for binary file access?.
>Since the answer is NO, I'd say you have nothing to worry about.
Why should the answer be No? If Microsoft is considering XML for
*all* data, why do you need binary file access? That's legacy
technology and has no place in the .NET world.
MM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks