Author Topic: A way to use 'enums'?  (Read 1326 times)

Offline Dark Schneider

  • Mr. Polyvector
  • ***
  • Posts: 128
    • View Profile
A way to use 'enums'?
« 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.

MrTAToad

  • Guest
Re: A way to use 'enums'?
« Reply #1 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

Offline Slydog

  • Prof. Inline
  • *****
  • Posts: 928
  • KodeSource
    • View Profile
    • KodeSource
Re: A way to use 'enums'?
« Reply #2 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.

My current project (WIP) :: TwistedMaze <<  [Updated: 2015-11-25]

Offline hardyx

  • Community Developer
  • Dr. Type
  • ******
  • Posts: 486
    • View Profile