Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (Destination As Any, Source As Any, ByVal Length As Long)
Private Sub Command1_Click()
Dim num As Single
num = 1.11
Dim buff(3) As Byte
CopyMemory buff(0), num, 4
Dim s As String
s = Hex(buff(3)) + " " + Hex(buff(2)) + " " + Hex(buff(1)) + " " + Hex(buff(0))
MsgBox s
End Sub
Private Sub Command2_Click()
Dim s As String
s = "3F 8E 14 7B"
Dim buff(3) As Byte
Dim a() As String
a = Split(s, " ")
Dim i As Long
For i = UBound(a) To 0 Step -1
buff(3 - i) = Val("&H" + a(i))
Next
Dim J As Single
CopyMemory J, buff(0), 4
MsgBox CStr(J)
End Sub