VB 16进制转10进制
蔡鸟编程中遇到了个问题,代码如下
Private Sub CommandButton1_Click()
Dim test1 As Long
test1 = &H7999
test2 = &H8000
Debug.Print "test1:" & test1
Debug.Print "test2:" & test2
End Sub
结果:
test1:31129
test2:-32768
为何&H8000 以下的转化都是正确的,&H8000以上的转换为16进制后都变成负数了,问题在那里?
给你个现成的,不要你积分
http://download.csdn.net/source/1212613
默认的&Hxxxx是Integer类型的,你要在末尾加&声明为Long类型的。
VB code:
Private Sub CommandButton1_Click()
Dim test1 As Long
test1 = &H7999&
test2 = &H8000&
Debug.Print "test1:" & test1
Debug.Print "test2:" & test2
End Sub
学习
相关问答:
请教一下:我用vb写了一个调用Illustrator的测试程序,代码很简单:Private Sub Command1_Click()
Dim app As New Illustrator.Application
Dim doc As Illustrator.Document
Dim thislayer As Illustrator.Layer ......
TF1.text = " <_2_ZCHGZBH> " & MSFlexGrid1.TextMatrix(k, 1) & " </_2_ZCHGZBH> "
大家好,我用上面一个东西赋值 TF1.text = & ......
"insert into user1(name,age) values('" & Text1.Text & "','" & Text2.Text & "' )"
问题:对sql语句中单、双引号模糊。既然 Text1.Text就表示 ......
Option Explicit
Private Sub Command1_Click()
WebBrowser1.Navigate "http://mc.qeedoo.com/servers.php"
End Sub
Private Sub WebBrowser1_DocumentComplete(ByVal ......
菜鸟学VB,各位大侠能帮助我么,我的QQ是544508194,mail. huguyue619@163.com
恳请各位大侠加我,指点小弟一二
请经常光顾本论坛,有疑难众多高手都会尽力.
动手实践写代码,经常光顾本论坛浏览与学习.
......