请各位易做图帮忙给个能把100转化为42c80000的VB6.0代码!!!
请各位易做图帮忙给个能把100转化为42c80000的VB6.0代码!!! --------------------编程问答--------------------Dim s as String--------------------编程问答-------------------- 这样提问,大侠们真的不好回答你。学习下提问的艺术吧。
s="100"
Debug.Print "42c800" & Right(s,2)
锅搞笑一次,不用给分。哈哈哈哈 --------------------编程问答-------------------- --------------------编程问答--------------------
是将100转换为Single数据类型的4个字节并以16进制字符串显示:
Option Explicit--------------------编程问答--------------------
Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (Destination As Any, Source As Any, ByVal Length As Long)
Dim i As Long
Private Sub Command1_Click()
Dim hexData As String
Dim a As Single
Dim Buffer(3) As Byte
a = 100
CopyMemory Buffer(0), a, 4
For i = 0 To 3
If Len(Hex(Buffer(i))) = 1 Then
hexData = "0" & Hex(Buffer(i)) + hexData
Else
hexData = Hex(Buffer(i)) + hexData
End If
Next
Debug.Print hexData
End Sub
我幻想到他可能是100转换成single,double之类
嘿嘿,还是你有心去验证了 --------------------编程问答-------------------- 大家继续猜楼主真实想问的是什么,猜中有分可奖,哈哈.
补充:VB , 基础类