vb中声明符号常量的关键字

如题所述

用Const声明常量。语法为:

[Public|Private] Const 符号常量名 [As 类型] = 表达式

 例如

Private Const MyConst As Integer = 1000
Const MyStringConst As String = "Hello" '默认为Private
Const PI As Double = 3.1415926 '默认为Private
Const MyVar = 1000 '默认为Private, MyVar的类型为Variant

温馨提示:答案为网友推荐,仅供参考
相似回答