- 17.05 (released) ...
To complete this study of the compilation process let's see a few more properties of how you can execute an Eiffel system, both in EiffelStudio and as a compiled system that you deliver to its users, who may need to run it without EiffelStudio.
Our example system is very simple and has no need for execution arguments. In more advanced cases you may want to pass values to the execution, such as a numeric parameter or a file name, so that you can have different executions without changing and recompiling the software.
In the Eiffel text, you can access such run-time arguments through the Kernel Library class
ARGUMENTS. There is another technique -- using the arguments to the root creation procedure -- but using
ARGUMENTS is the most general way. Any class of your system can inherit from
ARGUMENTS and use queries
argument_count to know the number of arguments passed to the execution, and
argument (i), for
i between 1 and
argument_count to access the
i-th element. Class
ARGUMENTS has more features; since you have Eiffelstudio up, you can check the details if you wish (use the contract form).
There are 2 ways to specify execution arguments from within EiffelStudio. The first is through the menu path
Execution --> Execution Parameters .
The second is through the argument dialog which can be opened by right-clicking on any of the debugging or program execution buttons on the main toolbar. The latter is more convenient for quick and easy access to execution arguments.
Executing from EiffelStudio
We have seen how to execute a compiled system from within EiffelStudio: choose one of the appropriate execution buttons, with or without breakpoints.
Executing a finalized system outside of EiffelStudio
A finalized system can be executed on any computer of the appropriate platform; it doesn't need EiffelStudio. The executable version is in the directory
project_directory is the project's directory and
target_name is the name of the target. The name of the executable file is
system_name.exe on Windows) where
system_name is the name that you have assigned to your system in the project settings (reflected in the ECF file).
The target of the Guided Tour system is
classic and the name is
simple, so you can locate
simple.exe on Windows) in
EIFGENs/classic/F_code for your project, and run it stand-alone if you like.
If you run the system from a command line, and it requires arguments (
simple doesn't), you will provide the appropriate arguments after the command name:
system_name ... arg ... .
Because various platforms have different conventions, "relative paths" referenced in your system will mean something different under Unix/Linux, where they relate to the directory from which the command is launched, and under Windows, where they relate to the application's directory.
Executing a frozen or melted system outside of EiffelStudio
A system compiled in "Workbench mode" -- frozen or melted -- is normally meant for execution within EiffelStudio, not for outside delivery, since it is not optimized. If you need to execute it outside of EiffelStudio, make sure that you have access to the
system_name.melted file in
With this discussion of compilation and execution we have finished our review of the key capabilities of EiffelStudio. Not everything has been covered, but you are now familiar with the essentials and ready to discover the rest by yourself, both by trying out various capabilities -- most of which should be self-explanatory -- and examining the extensive online documentation that accompanies the product.
- Parent <Using AutoTest>