public Function strToHex(str As String) As Integer
Dim intH, intL As Integer
intH = Asc(Mid$(str, 2, 1))
intL = Asc(Mid$(str, 3, 1))
If intH >= 48 And intH <= 57 Then
intH = intH - 48
Else
intH = intH - 65
End If
If intL >= 48 And intL <= 57 Then
intL = intL - 48
Else
intL = intL - 65
End If
strToHex = intH * 16 + intL
End Function
不好意思,明天出差去宁波,今天没把程序带回来,礼拜4吧,晚上把程序给大家公开,虽然不很复杂,但是也是我弄了1个礼拜多啊!刚开始做没经验,难免的。
飞雪姐姐,你的程序偶不能用啊,我把你做的函数烤过去,调试的时候说
intL=asc(mid$(str,3,1))无效
8过偶想到了个简便方法,你看你用的上不,就是字符串改数字的
DIM A AS STRING
DIM B AS STRING
DIM C AS STRING
A=MID(MSCOMM1。INPUT,6,2)
B="&H"+A
C=val(B)
text1.text=C
哈哈,解决问题,16化10显示~~~~~~~~~
各位试试很好用的啊,用好了记得偶小飞侠啊~~~~~~~~~~~