# Euphoria常數

 ```constant MAX = 100 constant Upper = MAX - 10, Lower = 5 constant name_list = {"Fred", "George", "Larry"} ```

## 範例:

 ```#!/home/euphoria-4.0b2/bin/eui constant MAX = 100 constant Upper = MAX - 10, Lower = 5 printf(1, "Value of MAX %d\n", MAX ) printf(1, "Value of Upper %d\n", Upper ) printf(1, "Value of Lower %d\n", Lower ) MAX = MAX + 1 printf(1, "Value of MAX %d\n", MAX ) ```

 ```./test.ex:10 <0110>:: may not change the value of a constant MAX = MAX + 1 ^ Press Enter ```

 ```Value of MAX 100 Value of Upper 90 Value of Lower 5 ```

# 列舉：

## 範例:

 ```#!/home/euphoria-4.0b2/bin/eui enum ONE, TWO, THREE, FOUR printf(1, "Value of ONE %d\n", ONE ) printf(1, "Value of TWO %d\n", TWO ) printf(1, "Value of THREE %d\n", THREE ) printf(1, "Value of FOUR %d\n", FOUR ) ```

 ```Value of ONE 1 Value of TWO 2 Value of THREE 3 Value of FOUR 4 ```

 ```#!/home/euphoria-4.0b2/bin/eui enum ONE, TWO, THREE, ABC=10, XYZ printf(1, "Value of ONE %d\n", ONE ) printf(1, "Value of TWO %d\n", TWO ) printf(1, "Value of THREE %d\n", THREE ) printf(1, "Value of ABC %d\n", ABC ) printf(1, "Value of XYZ %d\n", XYZ ) ```

 ```Value of ONE 1 Value of TWO 2 Value of THREE 3 Value of ABC 10 Value of XYZ 11 ```

Euphoria 序列使用整數索引，但用列舉，可能會寫這樣的程式碼：

 ```enum X, Y sequence point = { 0,0 } point[X] = 3 point[Y] = 4```