# Keyword Reference

Enum

Enumerates variables.

[scope] Enum [Step <stepval>] <variablelist>

Parameters

scope | [optional] The scope the Enum should be placed in, either Local, Global, Dim or none. If none, Dim behavior is used.
stepval | [optional] The default step is to add 1. Other possible step methods are: *n, +n, -n where n is a whole number.
variablelist | A list variables to be enumerated.

Remarks

By default, the first variable will be 0 and the rest will be incremented by 1 from there.
When using the multiply operator to step, the first variable will be assigned 1 and the rest will be multiplied based on the previous variables value.
Variables can be explicitly assigned by any valid statement.

Related

Example

Global Enum $E1VAR1, $E1VAR2, $E1VAR3
MsgBox(4096, "", "Expect 0: " & $E1VAR1)
MsgBox(4096, "", "Expect 1: " & $E1VAR2)
MsgBox(4096, "", "Expect 2: " & $E1VAR3)
Global Enum $E2VAR1 = 10, $E2VAR2, $E2VAR3 = 15
MsgBox(4096, "", "Expect 10: " & $E2VAR1)
MsgBox(4096, "", "Expect 11: " & $E2VAR2)
MsgBox(4096, "", "Expect 15: " & $E2VAR3)
Global Enum Step *2 $E3VAR1, $E3VAR2, $E3VAR3
MsgBox(4096, "", "Expect 1: " & $E3VAR1)
MsgBox(4096, "", "Expect 2: " & $E3VAR2)
MsgBox(4096, "", "Expect 4: " & $E3VAR3)