1. enum type

From the docs:

enum type color RED=4, GREEN=7, BLACK=1, BLUE=3 , PINK=10 end type 
 
? color(RED)   --> 1 
? color(GREEN) --> 2 
? color(BLACK) --> 3 
? color(BLUE)  --> 4 
? color(PINK)  --> 5 
 
constant color_names = {"rouge", "vert", "noir", "bleu", "rose"} 
 
puts(1, color_names[color(BLUE)]) --> bleu 

In real life:

irv@irv-desktop:~/new_gtk$ eui enums.ex 
1 
1 
1 
1 
1 
rouge 

Euphoria Interpreter v4.2.0 development 
   64-bit Linux, Using System Memory 
   Revision Date: 2025-01-24 03:31:36, Id: 22b5124 

new topic     » topic index » view message » categorize

2. Re: enum type

Hi Irv

So this works as expected on My Win system (not your IRL)

Incidentally, it looks like enum overrides the assignments for a list of variables - is this expected behaviour?

Cheers

Chris

new topic     » goto parent     » topic index » view message » categorize

3. Re: enum type

irv said...

In real life:

irv@irv-desktop:~/new_gtk$ eui enums.ex 
1 
1 
1 
1 
1 
rouge 

Euphoria Interpreter v4.2.0 development 
   64-bit Linux, Using System Memory 
   Revision Date: 2025-01-24 03:31:36, Id: 22b5124 

Same for me on Windows X64 with same release 4.2.0 development.

Jean-Marc

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu