Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试使用枚举,并且正在疯狂地试图从中获得正确的价值。
Enum DiscountRates As Long x = 0.05 y = 0.1 z = 0.15 End Enum
所以如果我这样做
MessageBox.Show(DiscountRates.x)
我想我会回来 .05 或者我可以用它来分配一个值....如果我把它打印出来,它只会打印 0
我最初把它作为一个双,但VB不会让它被声明为一个
枚举仅支持整数。您需要求助于其他选择,例如:
Const x As Single = 0.05
看看:https ://stackoverflow.com/a/655055/290343