convent ByteArray To DecimalArray

Posted on 2009-04-16
Last Modified: 2012-05-06
hay to All
What is the fastest way to convent a ByteArray To DecimalArray
Question by:sayeth
    LVL 76

    Accepted Solution

    It isn't clear what you want to do. There is no type (in VB6 etc.) called decimal, so let us start with this.

        Dim bb(10) As Byte
        Dim dd() As Single
        Dim i As Integer
        ReDim dd(UBound(bb))
        For i = 0 To UBound(bb)
            dd(i) = CSng(bb)
        Next i

    Open in new window

    LVL 1

    Author Comment

    Thanks.  Just one little error problem i had to fix, but your answer is right
    Dim bb(10) As Byte
    Dim dd() As Single
    Dim i As Integer
        ReDim dd(UBound(bb))
        For i = 0 To UBound(bb)
            dd(i) = BitConverter.ToSingle(bb, 0)
        Next i
    thank for the help. but one more question  on the same topic. i wrote a code that convert single array to bytes array - it work fine but i want a faster way because the single array is very large
    i= 0
    For lvI = 0 To UBound(dd)     'dd is very large
       bb(i)= BitConverter.GetBytes(dd(lvI))

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Join & Write a Comment

    Introduction While answering a recent question ( in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
    This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
    Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
    Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now