Name
Enum Statement
Syntax
accessmodifierEnumname[Astype]membername [= constantexpression]membername [= constantexpression]... End Enum
-
accessmodifier Use: Optional
Type: Keyword
The possible values of
accessmodifierarePublic,Private,Friend,Protected, orProtectedFriend. For more information, see Section 3.7 in Chapter 3.-
name Use: Required
Type: String literal
The name of the enumerated data type.
-
membername Use: Required
Type: String literal
The name of a member of the enumerated data type.
-
constantexpression Use: Optional
Data Type: Long
The value to be assigned to
membername.-
type Use: Optional
Type: Keyword
The data type of the enumeration. All enumerated members must be integers; possible values are
Byte,Short,Integer, andLong.
Description
Defines an enumerated data type. All of the values of the data type
are defined by the instances of
membername.
Rules at a Glance
The
Enumstatement can only appear at module level, in the declarations section of a form, code module, or class module.Access rules for Enums are the same as for variables and constants. In particular, the optional
accessmodifiercan be any one of the following:Public,Private,Protected,Friend, orProtectedFriend. The following table describes the effects of the various access modifiers:
|
Direct access scope |
Class/object access scope | |
|---|---|---|
|
Private |
Declaring class |
Declaring class |
|
Protected |
All derived classes |
Declaring class |
|
Friend |
Derived in-project classes |
Declaring project |
|
Protected Friend |
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access