On windows, Euphoria reads every location in the following order:

  1. %ALLUSERSPROFILE%\euphoria\eu.cfg
  2. %APPDATA%\euphoria\eu.cfg
  3. %EUDIR%\eu.cfg
  4. %HOMEDRIVE%\%HOMEPATH%\eu.cfg
  5. From where ever the product is run: <exepath>/eu.cfg
  6. The current working directory: ./eu.cfg
  7. The command line

On unix, Euphoria reads every location in the following order:

  1. /etc/euphoria/eu.cfg
  2. ${EUDIR}/eu.cfg
  3. ${HOME}/eu.cfg
  4. From where the product is run: <exepath>/eu.cfg
  5. The current working directory: ./eu.cfg
  6. The command line

Switch Properties

A switch will have one of the following behaviors:

  • For a shadowing switch the last switch is the active switch.

For example, the -silent and -verbose pair:

    euc -silent -verbose hello.ex   
    --> "-verbose" is the active switch  
  • A stacking switch collects all arguments and pushes them onto a stack.

For example, if you are tired of writing /std before console.e then create a eu.cfg file:

-- configuration file in local directory 
-i /usr/share/euphoria/include/std/ 
-- program in the local directory 
include console.e 
display( "look no `/std` needed!") 
    --> look no `/std` needed! 

The include directory switch (-i) stacks paths as they are entered. Starting at the freshest path, all paths are searched until a file is found. Effectively, older paths are shadowed.

  • A collecting switch gathers all switches, allows duplicates anywhere, and ignores duplicated arguments.

For example, the -d switch collects words to be processed by ifdef conditional statements.

-- program file: test.ex 
ifdef Wallace then 
    puts(1, "word is Wallace\n") 
    end ifdef 
ifdef Grommet then 
    puts(1, "word is Grommet\n") 
    end ifdef 
-- entered on the command line: 
eui -d Grommet -d Wallace -d Grommet test.ex    
--> word list is:  Grommet Wallace 
--> output is: 
    -- word is Wallace 
    -- word is Grommet 
  • A directing switch controls how switches are input.

For example, the -c switch selects configuration files. Use it to pick a file and nest its contents into a switch_list.

    eui -c myspecial.cfg hello.ex 
    --> the contents of "myspecial.cfg" are nested into  
    --  the switches found on the command line 

Switches (except for a collecting switch) do not allow duplicates in one location. However, duplicate switches are allowed if they are in different locations.

Some switches are "toggle on" only; there may not be a corresponding "toggle off" state.

In a configuration file, use a section header to specify which switches are active for a given mode.

Not Categorized, Please Help


Quick Links

User menu

Not signed in.

Misc Menu