ie:
I'm making a program where an array holds the element types I'm going to draw
This is how I do it now:
Dim LCAR_Button As Int,LCAR_Elbow As Int,LCAR_Textbox As Int, LCAR_Slider As Int
LCAR_Button=0:LCAR_Elbow=1:LCAR_Textbox=2:LCAR_Slider=3
I'd like to have it:
enum( LCAR_Button,LCAR_Elbow,LCAR_Textbox, LCAR_Slider)
And like VB, have B4A automatically assigns them values starting from 0
though in VB we can set a value if we want to, ie:
enum( LCAR_Button,LCAR_Elbow,LCAR_Textbox=99, LCAR_Slider)
enums are automatically longs in VB, but I guess INT would be fine in B4A
This is particularly useful for intellisense in VB, when entering a parameter in a function, or entering a select case, it'll pop up with a list of the enum values for us to click.
ie:
sub test(temp as boolean)
select case temp
if we were to type "case " (or get to that parameter in a function) a drop down would appear with true and false in it
This makes it easier to keep track of acceptable/expected values and results in neater code