enum type

new topic     » topic index » view thread      » older message » newer message

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 thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu