枚举中的VB括号? [英] VB Brackets in Enum?
本文介绍了枚举中的VB括号?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在一些遗留代码中发现了这一点,只是好奇括号的用途是什么?
I'm finding this in some legacy code and just curious what the brackets are for?
Public Enum myEnum
none = 0
abc = 2
def = 4
ghi= 6
[jkl] = 8
mno = 9
End Enum
推荐答案
在您提供的示例中不需要它们,我假设您已将其隐藏,但括号可让您指定枚举项的名称,否则与保留字冲突.
They're not needed in the example you provided, which I assume you have obscured, but the brackets let you specify a name for an enum item that would otherwise conflict with a reserved word.
这篇关于枚举中的VB括号?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文