Asc() Chr() VB to VB.NET Function - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Asc() Chr() VB to VB.NET Function

Hugo_DufortHugo_Dufort Posts: 17Member
I every body !
I'll like to to know if using old function like Asc(), Chr() in VB.NET is a good thing, or if there is a "VB.NET" way to do those kind of function.

Tanks you !!


Comments

  • BaldusariusBaldusarius Posts: 162Member
    The ".NET way" would be to use the System.Convert class (Convert.ToInt32(Char), Convert.ToChar(Int32), etc.), but there is really no reason you shouldn't use the functions contained in the Microsoft.VisualBasic namespace, such as Asc and Chr. In fact, if you open Microsoft.VisualBasic.dll with Ildasm.exe, you'll see calls to System.Convert in those methods. Of course, any time you wrap a function in another function, there will be a performance difference, but no so much that you'd need to worry about it.

    Use whatever you feel comfortable with.

    : I every body !
    : I'll like to to know if using old function like Asc(), Chr() in VB.NET is a good thing, or if there is a "VB.NET" way to do those kind of function.
    :
    : Tanks you !!
    :
    :
    :

  • Hugo_DufortHugo_Dufort Posts: 17Member
    Tanks a lot !!!
    this is the exacte question i'm looking for !!



    : The ".NET way" would be to use the System.Convert class (Convert.ToInt32(Char), Convert.ToChar(Int32), etc.), but there is really no reason you shouldn't use the functions contained in the Microsoft.VisualBasic namespace, such as Asc and Chr. In fact, if you open Microsoft.VisualBasic.dll with Ildasm.exe, you'll see calls to System.Convert in those methods. Of course, any time you wrap a function in another function, there will be a performance difference, but no so much that you'd need to worry about it.
    :
    : Use whatever you feel comfortable with.
    :
    : : I every body !
    : : I'll like to to know if using old function like Asc(), Chr() in VB.NET is a good thing, or if there is a "VB.NET" way to do those kind of function.
    : :
    : : Tanks you !!
    : :
    : :
    : :
    :
    :

Sign In or Register to comment.