Results 1 to 5 of 5

Thread: EXCEL: How To: Convert Byte Array To Single [RESOLVED]

Threaded View

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    May 2004
    Location
    Carlisle, PA
    Posts
    1,045

    Resolved EXCEL: How To: Convert Byte Array To Single [RESOLVED]

    Esteemed Forum Participants and Lurkers:
    ===============================
    Excel 2003 VBA

    How do I convert an Array of Bytes into a Single?

    I know that the 4-Byte IEE 754 hex code in Single format for -8.125 = C1020000

    I Dim a byte array:
    Code:
        Dim aByte(3) As Byte
        aByte(3) = &HC1
        aByte(2) = &H2
        aByte(1) = 0
        aByte(0) = 0
    OK ... the order is probably reversed ... but how do I get this into a type Single variable "aSing" so that I can "MsgBox aSing" and display the correct decimal value? Of course, this is just asking how to implement C's "AddressOf" pointer in VBA.
    Last edited by Webtest; May 9th, 2006 at 09:35 AM.
    Blessings in abundance,
    All the Best,
    & ENJOY!

    Art . . . . Carlisle, PA . . USA

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width