Re: Euphoria file types

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

Oops, By 'file types' I mean 'file extensions'.


From this Forum I got:
.ex exwc, exu console/server application .exw exw, exu windowed (as in GUI, not as in Windows) application .exd ex DOS application .e - include file .exw for exwc for the Windows version. and .ex for ex.exe DOS version.


From DOCS:
"CON" - the console (screen) "AUX" - the serial auxiliary port "COM1" - serial port 1 "COM2" - serial port 2 "PRN" - the printer on the parallel port "NUL" - a non-existent device that accepts and discards output Close a file or device when done with it, flushing out any still-buffered characters prior.


From DOCS:
"r" - open text file for reading "rb" - open binary file for reading "w" - create text file for writing "wb" - create binary file for writing "u" - open text file for update (reading and writing) "ub" - open binary file for update "a" - open text file for appending "ab" - open binary file for appending


I finally did find the following at:
http://openeuphoria.org/docs/eu400_0009.html#_34_Euphoriaprograms
2.1.5 Running a Program To run a Euphoria program you type the name of the interpreter followed by the filename of the program you want to run. Such as: ex example.ex What you just typed is known as the command-line. Depending on the platform you are using the interpreter could be called:
ex
exw
exwc
exu
The command-line may contain extra information. Following your program filename you may add extra words (known as arguments) that can used in your program to customize its behavior. These arguments are read within your program by the built-in function command_line(). Optionally, you may also use command line switches that are typed between the interpreter name and the program name. Command line switches customize how the interpreter itself behaves. Unlike many other compilers and interpreters, there is no obligation for any special command-line options for ex, exw or exu. Only the name of you Euphoria file is expected, and if you don't supply it, you will be prompted for it. The DOS32 version of the Euphoria interpreter is called ex.exe. The WIN32 version is called exw.exe and the WIN32 console version is called exwc.exe. The Linux/FreeBSD version is called exu. Euphoria is forgiving about your choice of file extensions. By convention, main Euphoria files have an extension of .ex, .exw, or .exu. Other Euphoria files, that are meant to be included in a larger program, end in .e or sometimes .ew or .eu. To save typing, you can leave off the ".ex", and the ex command will supply it for you automatically. exw.exe will supply ".exw", and exu will supply ".exu". Each will try the other possible extensions as well if the default fails. If the file can't be found in the current directory, your PATH will be searched (using the most likely extension, then the others). You can redirect standard input and standard output when you run a Euphoria program, for example: ex filesort.ex < raw.txt > sorted.txt or simply, ex filesort < raw.txt > sorted.txt
Under Windows, you will need to use Start -> Run... facility if you need to enter command line switches or other arguments to a .exw program.
For frequently-used programs under DOS/Windows you might want to make a small .bat (batch) file, perhaps called myprog.bat, containing two statements like:
@echo off
ex myprog.ex %1 %2 %3 %4 %5 %6 %7 %8 %9
The first statement turns off echoing of commands to the screen. The second runs ex myprog.ex with up to 9 command-line arguments. See command_line() for an example of how to read these arguments. Having a .bat file will save you the minor inconvenience of typing ex (or exw) all the time; i.e., you can just type: myprog instead of: ex myprog Unfortunately DOS will not allow redirection of standard input and output when you use a .bat file. However, this works in a Windows DOS box. Under Linux/FreeBSD, you can type the path to the Euphoria interpreter on the first line of your main file, e.g. if your program is called foo.exu:

  1. !/home/rob/euphoria/bin/exu procedure foo() ? 2+2 end procedure foo() Then if you make your file executable: chmod +x foo.exu You can just type: foo.exu to run your program. You could even shorten the name to simply "foo". Euphoria ignores the first line when it starts with #!. Be careful though that your first line ends with the Linux/FreeBSD-style \n, and not the DOS/Windows-style \r\n, or the Linux/FreeBSD shell might get confused. If your file is shrouded, you must give the path to backendu, not exu. You can also run bind.bat (DOS32), or bindw.bat (WIN32) or bindu (Linux/FreeBSD) to combine your Euphoria program with ex.exe, exw.exe or exu, to make a stand-alone executable file (.exe file on DOS/Windows). With a stand-alone .exe file you can redirect standard input and output. Binding is discussed further in Distributing a Program. Using the Euphoria to C Translator, you can also make a stand-alone .exe file, and it will normally run much faster than a bound program. exu, ex.exe, exw.exe and exwc will be in the euphoria\bin directory which must be on your search path. The environment variable EUDIR should be set to the main Euphoria directory, e.g. c:\euphoria. 2.1.6 Running under Windows You can run Euphoria programs directly from the Windows environment, or from a DOS shell that you have opened from Windows. By "associating" .ex files with ex.exe, and .exw files with exw.exe you can simply double-click on a .ex or .exw file to run it. Under Windows you would define a new file type for .ex, by clicking on My Computer / view / options / file types. It is possible to have several Euphoria programs active in different windows. If you turn your program into a .exe file, you can simply double-click on it to run it.
new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu