GLBasic forum

Main forum => GLBasic - en => Topic started by: Dark Schneider on 2010-Jun-04

Title: A way to use 'enums'?
Post by: Dark Schneider on 2010-Jun-04
Note: the forum search doesn't work.

I'd like to know if there is a way to use enum to define values, in example, the typical case:

enum MyTypes {None, Type1, Type2...};

TYPE
ttype as MyTypes
ENDTYPE

Or something like that. I'd tested with INLINE for the enum but then it is not recognized.
Title: Re: A way to use 'enums'?
Post by: MrTAToad on 2010-Jun-04
No, it would be nice though

You could either use enum with INLINE and do a wrapper to return the value back or setup a list of CONSTANTS
Title: Re: A way to use 'enums'?
Post by: Slydog on 2010-Jun-04
I resorted to using CONSTANTS myself.
Not that big of a deal, since we don't have any form of 'intellisense' functionality, which would make enums way more convenient.
But enums can work like a type for functions, which would be handy.

In c++, do enums get converted to the constant value during pre-processing? 
Or are they left intact internally for function parameters?
I was just wondering how easy it would be to add them to GLBasic.  On the surface it seems simple, but I have no idea.

What DID happened to the searching?
I've resorted to using Google searches like:
enums site:www.glbasic.com
to restrict searches to this site, it works OK guess.

Title: Re: A way to use 'enums'?
Post by: hardyx on 2010-Jun-16
Look this post:
http://www.glbasic.com/forum/index.php?topic=2720.0