Hex-Value in Visual Basic

我怕爱的太早我们不能终老 提交于 2019-12-18 18:50:07

问题


Can someone just help me refresh my mind?

How do you specify hex values in a Visual Basic 6 / VBScript Source?

It's not 0xABCD as it is in C++, that's what I can remember... It was something similar... But what?


回答1:


Try &HABCD, that's how it works for most BASIC languages.




回答2:


VBScript \ VBA \ VB6 (and lower):

Dim MyValue As Integer
MyValue = &h1234

VB (.NET Framework):

Dim MyValue As Integer = &h1234

Versions are usually backwards compatible syntax-wise, you cannot always use newer syntax in older versions.




回答3:


&H<hex-value> if my memory serves my correctly.

Like: &HABCD




回答4:


msgbox hex(255)



来源:https://stackoverflow.com/questions/428643/hex-value-in-visual-basic

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!