16进制加减怎么算
发布网友
发布时间:2022-06-14 04:32
我来回答
共1个回答
热心网友
时间:2023-10-17 03:51
Option Explicit
Dim a As String
Dim b As String
Dim c As Double
VB的16进制计算可由VAL函数取10进制值后计算,然后再将结果用HEX函数转变会16进制显示:
Private Sub Command1_Click()
a = "&H" & Text1: b = "&H" & Text2
c = Val(a) - Val(b)
Text3 = Hex(c)
End Sub
Private Sub Form_Load()
Text1 = "": Text2 = "": Text3 = ""
End Sub