none
understanding one line of vb code RRS feed

  • Question

  • Hi,

    c# guy here :)

    can you please confirm me please if the following is a valid vb code

    IVTPXML() As Byte = {&H13, &H14, &H53, &H18, &H30, &HA1, &H3D, &H1F}

    this was given to me by a client

    i dont even know if it's a function declaration, an array .... etc

    and what can the equivalent c# code to it

    thanks .

    Wednesday, February 5, 2020 6:12 PM

Answers

  • C# version, note I've lower cased the variable name

    byte[] ivtpxml = { 0x13, 0x14, 0x53, 0x18, 0x30, 0xA1, 0x3D, 0x1F };


    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange

    • Proposed as answer by Andrew B. Painter Wednesday, February 5, 2020 6:41 PM
    • Marked as answer by issam1975 Wednesday, February 5, 2020 7:57 PM
    Wednesday, February 5, 2020 6:28 PM
    Moderator

All replies

  • C# version, note I've lower cased the variable name

    byte[] ivtpxml = { 0x13, 0x14, 0x53, 0x18, 0x30, 0xA1, 0x3D, 0x1F };


    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange

    • Proposed as answer by Andrew B. Painter Wednesday, February 5, 2020 6:41 PM
    • Marked as answer by issam1975 Wednesday, February 5, 2020 7:57 PM
    Wednesday, February 5, 2020 6:28 PM
    Moderator
  • It is a Byte array

    In C#, you can do :

    var IVTPXML = new byte[] { 0x13, 0x14, 0x53, 0x18, 0x30, 0xA1, 0x3D, 0x1F };

    Wednesday, February 5, 2020 6:35 PM
  • thanks Karen .

    really appreciate

    Wednesday, February 5, 2020 7:58 PM
  • thanks Karen .

    really appreciate

    Your very welcome :-)

    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange

    Wednesday, February 5, 2020 8:52 PM
    Moderator