Gambas Documentation
Application Repository
Code Snippets
Compilation & Installation from source code
Components
Controls pictures
Deprecated components
Developer Documentation
Development Environment Documentation
Documents
Error Messages
Gambas Playground
How To's
Language Index
Language Overviews
Arithmetical Functions
Arithmetic Operators
Array Declaration
Assignment Operators
Assignments
Binary Data Representation
Bits Manipulation Functions
Character Test Functions
Comparison methods
Complex numbers
Constant Declaration
Constant Expression
Conversion Functions
Datatype Functions
Datatypes
Date & Time Functions
Enumeration declaration
Error Management
Event Loop
Event Management
Events declaration
Expressions
External Function Management
File & Directory Functions
File & Directory Paths
File mode syntax
Floating Point Numbers
Formatting functions
Gambas Object Model
Global Special Event Handlers
Integer numbers
Intrinsic Functions
Language Constants
Localization and Translation Functions
Local Variable Declaration
Logarithms & Exponentials Functions
Logical Operators
Loop Control Structures
Method Declaration
Miscellaneous Control Structures
Miscellaneous Functions
Native Arrays
Native Container Classes
Object & Class Management
Operator Evaluation Order
Predefined Constants
Process Management
Property Declaration
Random Numbers Functions
Special Methods
Stream & Input/Output functions
String Functions
String Operators
Structure declaration
Test Control Structures & Functions
Trigonometric Functions
User-defined formats
Using reserved keywords as identifiers
Variable Declaration
Last Changes
Lexicon
README
Search the wiki
To Do
Topics
Tutorials
Wiki License
Wiki Manual

Enumeration declaration

{ PUBLIC | PRIVATE } ENUM Identifier [ = Value ] [ , Identifier [ = Value ] ... ]

This keyword declares an enumeration, i.e. a list of integer constants.

If the Value of a constant is not specified, then it will be the value of the previous constant plus one, or zero for the first constant.

All constants are accessible everywhere in the class they are declared.

If the PUBLIC keyword is specified, they are also accessible to the other classes having a reference to an object of this class.

Since 3.17

The value of an enumeration identifier can be define by a constant expression.

Examples

Public Enum Normal = &H00, {Left} = &H01, {Right} = &H02, Center = &H03, TopNormal = &H10, TopLeft = &H11, TopRight = &H12,
  Top = &H13, BottomNormal = &H20, BottomLeft = &H21, BottomRight = &H22, Bottom = &H23

Private Enum None, Horizontal, Vertical, Row, Column, Fill

See also