updating oE command_line


<built-in> function command_line() 

returns sequence of strings containing each word entered at the command-line that started your program.

  1. The path, to either the Euphoria executable (eui, eui.exe, euid.exe, euiw.exe) or to your bound executable file.
  2. The next word, is either the name of your Euphoria main file or (again) the path to your bound executable file.
  3. Any extra words, typed by the user. You can use these words in your program.

There are as many entries as words, plus the two mentioned above.

The Euphoria interpreter itself does not use any command-line options. You are free to use any options for your own program. The interpreter does have command line switches though.

The user can put quotes around a series of words to make them into a single argument.

If you convert your program into an executable file, either by binding it, or translationg it to C, you will find that all command-line arguments remain the same, except for the first two, even though your user no longer types "eui" on the command-line (see examples below).

Example 1:
 -- The user types:  eui myprog myfile.dat 12345 "the end" 
cmd = command_line() 
-- cmd will be: 
       "the end"} 
Example 2:
-- Your program is bound with the name "myprog.exe" 
-- and is stored in the directory c:\myfiles 
-- The user types:  myprog myfile.dat 12345 "the end" 
cmd = command_line() 
-- cmd will be: 
        "C:\MYFILES\MYPROG.EXE", -- place holder 
        "the end" 
-- Note that all arguments remain the same as in Example 1 
-- except for the first two. The second argument is always 
-- the same as the first and is inserted to keep the numbering 
-- of the subsequent arguments the same, whether your program 
-- is bound or translated as a .exe, or not. 
See Also:

build_commandline, option_switches, getenv, cmd_parse, show_help

Not Categorized, Please Help


Quick Links

User menu

Not signed in.

Misc Menu