Skip to content
Apoorv Singal edited this page Aug 30, 2020 · 1 revision

Enum is a user-defined data type in Volant. It is mainly used to assign names to integral constants, the names make a program easy to read and maintain.

Defining enum types

Enums are defined using the enum keyword.

enum Name {
    Name1 = optionalIntegralValue,
    Name2 = optionalIntegralValue,
    ...
};

Using enums

enum TestEnum { Prop1, Prop2 };

var: TestEnum;
var = TestEnum.Prop1;
Clone this wiki locally