vb中怎么把两个byte型变成一个Integer
我知道c语言可以这样写:uchara=0xcc,b=0x05;intc=0;c=b;c=c<<8;c=c&a;请问用VB语言怎么写?...
我知道c语言可以这样写:
uchar a = 0xcc, b = 0x05;
int c = 0;
c = b;
c = c<<8;
c = c & a;
请问用VB语言怎么写? 展开
uchar a = 0xcc, b = 0x05;
int c = 0;
c = b;
c = c<<8;
c = c & a;
请问用VB语言怎么写? 展开
展开全部
可以让它颤睁 乘于 256 ,使8位二基乱进制左移8个位,然后与另搏洞档个8位二进制相加。
看看效果:
Private Sub Command1_Click()
Dim b1 As Byte, b2 As Byte
b1 = &H43
b2 = &HDD
Dim i As Integer
i = b1 * 256 + b2
MsgBox Hex(i)
End Sub
看看效果:
Private Sub Command1_Click()
Dim b1 As Byte, b2 As Byte
b1 = &H43
b2 = &HDD
Dim i As Integer
i = b1 * 256 + b2
MsgBox Hex(i)
End Sub
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
Dim HH, LL As Byte
HH = &HFF '''H
LL = &HF6 '''L
Dim Yvalue As Integer
Yvalue = Val("银颤行&H" & Hex(HH) & IIf(LL < 16, "0", "洞猛") & Hex(LL))
Text14.Text = Yvalue / 100 ''显示锋哗 -0.1
HH = &HFF '''H
LL = &HF6 '''L
Dim Yvalue As Integer
Yvalue = Val("银颤行&H" & Hex(HH) & IIf(LL < 16, "0", "洞猛") & Hex(LL))
Text14.Text = Yvalue / 100 ''显示锋哗 -0.1
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询