Another Language - Page 18


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Page 18 of 18 FirstFirst ... 8161718
Results 256 to 261 of 261

Thread: Another Language

  1. #256
    Bill McCarthy Guest

    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>




















  2. #257
    Gary Nelson Guest

    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



  3. #258
    Kunle Odutola Guest

    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



  4. #259
    Bill McCarthy Guest

    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.











  5. #260
    Gary Nelson Guest

    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



  6. #261
    Mike Mitchell Guest

    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
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center