Does BlitzMax have ENUMs?

BlitzMax Forums/BlitzMax Beginners Area/Does BlitzMax have ENUMs?

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

what is the output, what does "enum" do?

It specifies a 'group' of constants. For example, if you have a function called CreateAlien(type), there are only going to be a set number of possible inputs that you support. A neat way of encapsulating that (and validating the inputs) is to use enums.

For example:

Enum AlienTypes
Alien=1
Predator=2
End Enum

Function CreateAlien(type:AlienTypes)
...
End function

CreateAlien(Alien) ' works
CreateAlien(3) ' doesn't work

Having said that, they're not something I miss enormously, although they are seriously handy if your IDE has intellisense, as you would see a dropdown of the valid enums to select from...