Dude, you're using enum in the wrong way, see this.
Enums
An enum is an "enumerator", and it essentially permits you to create your own limited data type with a list of constant values. Enums are
global scope variables (this is implicit, and they require no "global" suffix orglobalvar declaration) and they have the following structure:
enum
<variable>{
<constant> [=
<value>]}
In the following example, we create an enum for the colours of the rainbow and assign it various constants and default values:
Code:
enum rainbowcolors {
red,
orange,
yellow,
green,
blue,
indigo,
violet
}
The enum entries can only be
real numbers or
expressions with previous enums, and by default are numbered from 0 upwards, so our example given above would default to red = 0, orange = 1, yellow = 2, etc... You can also assign values to the enum variables at the time of creation, using real numbers or expressions:
Code:
enum rainbowcolors {
red = 5,
orange = 5 * 2,
yellow = 15,
green = 20,
blue = 25,
indigo = 30,
violet = 35 * enum_test.entry
}
Notice in the above example we use another enum to create an expression for "violet". This only works if the enum being referenced was created
before the enum that is using it in an expression, but it will not work for variables or functions, since the enum value must be able to be evaluated as a constant on compile.
To later access the value within a given enum type, you can use the point "." method, like this:
Code:
var value = rainbowcolours.green;
Note that you cannot modify the values for any enum constant after it has been created.