enum int value?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

enum int value?

Raoul Duke
hi,

are there any automagic int values for enums, so e.g. i could have an
array the size of the # of values in a given enum type?

thanks.

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: enum int value?

Raoul Duke
also, might enums ever know their own string identifier/name?

On Tue, Apr 5, 2011 at 6:20 PM, Raoul Duke <[hidden email]> wrote:
> hi,
>
> are there any automagic int values for enums, so e.g. i could have an
> array the size of the # of values in a given enum type?
>
> thanks.
>

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: enum int value?

Nicolas Cannasse
Le 06/04/2011 04:04, Raoul Duke a écrit :
> also, might enums ever know their own string identifier/name?

Type.enumConstructor

> On Tue, Apr 5, 2011 at 6:20 PM, Raoul Duke<[hidden email]>  wrote:
>> hi,
>>
>> are there any automagic int values for enums, so e.g. i could have an
>> array the size of the # of values in a given enum type?

Type.enumIndex and Type.createEnumIndex

Nicolas

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: enum int value?

Raoul Duke
hi,

On Tue, Apr 5, 2011 at 11:29 PM, Nicolas Cannasse
<[hidden email]> wrote:
> Type.enumConstructor
> Type.enumIndex and Type.createEnumIndex

cool, thank you.

--
haXe - an open source web programming language
http://haxe.org