Basics

Explains

Using the EULER windows

EULER uses two windows. The text window and the graphics window. In the Unix version, you have to switch between both by pressing the TAB key.

The text window contains the menu and is designed for user input and output of EULER. The graphics window is displayed, whenever EULER draws output. Unless the graphics screen has been cleared, EULER will redraw the screen automatically using an internal meta file. The graphics screen is visible as long as there is no text output. In this case, EULER pops the text screen to the forground.

Notebooks

This applies only to the notebook interface in Windows. Notebooks contain the command texts and output. Old commands can be edited and changed. Text may be added to commands to explain it. Notebook files can be given to other people or can be kept as documented computations. However, collections of functions should still be kept in *.e files. A notebook could accompany the definitions, which explains the use of the functions with examples. Another idea is to use notbooks for teaching mathematics.

The most important fact about notebooks is that EULER still uses the sequence of commands as they are executed. So if you change the value of a variable and go to previous command, the changed value is used.

You may not only change previous commands, but also delete them or insert new commands. Use the notebook menu to do this. If you change a command and execute it, its output is removed and EULER proceeds to the next command, unless you choose to insert new commands. In this case, a new command is inserted after the one, you just executed.

You can delete the output of commands. To do this, select a text area and use the command in the notebook menu. All output of selected commands will be deleted.

Notebooks in old versions of EULER

Notebooks can be loaded from all versions of EULER. However, you cannot edit them. Use

    >notebook filename

for that purpose. It will prompt you after each command. If you press the escape key, the file will be closed immediately. Otherwise, the command is executed. You can turn the prompt off with

    >prompt off

The Command Line

Text can be entered after the prompt (>) using the keyboard. If a letter is wrong, it can be cancelled with the Backspace key. The cursor keys position the cursor back and forth in the line. The line editor is always in insert mode, so any character is inserted at the cursor position. Pos 1 (Home) positions the cursor to the beginning of the line, and end to the end of the line. Escape clears all input. Shift plus -> or< - position the cursor one word to the right or left. Finally, the input is entered by pressing Return. Then EULER will start to interpret the command. The cursor can be at any position of the input line, when Return is pressed.

Previous input can be recalled with the cursor-up and cursor-down keys. (On the notebook version use these keys with SHIFT). If a command is recalled this way and entered with Return, cursor-down recalls the next command; i.e., cursor-up and cursor-down are always based on the last recalled command. Clearing the input line also makes the last command the base for recalling (use Escape or Control-Cursor-Up). Thus Escape plus cursor-up recalls the previous command.

The notebook interface uses the escape key to end a function definition. It will not clear the input line. Use Control-Cursor-Up instead.

Pressing the Insert key extends incomplete commands. Pressing this key again gives another extension, if there is one. The search goes through the command history, the implemented functions, the user defined functions and the built-in commands in that order.

There are some other special keys. The Tabulator key switches to the Graphics screen and from there any key switches back. The Escape key stops any running EULER program and some internal functions, like the 3-dimensional plots, the linear equation solver and the polynomial root finder.

The Page-Up and Page-Down keys provide a means to look at previous output from EULER. EULER keeps a record of the last output. When the command line becomes invisible, pressing any key will make it reappear.

Input can spread over several lines by the use of "..". The two dots are allowed at any place, where a space is acceptable. E.g.

    >3+ .. some comment
    >4

is equivalent to

    >3+4

Comments can follow the ".." and are skipped.

The function keys may be programmed by the command

    >setkey(number,"text");

The number must be between 1 and 10 and the "text" may be any EULER string. Then the corresponding function key will produce the text, when it is pressed together with the ALT key . If the function key text is to contain a ", one can use char(34) and the EULER string concatenation, as in the example

    >setkey(1,"load "|char(34)|"test"|char(34)|";");

which puts

    >load "test";

on the function key Shift-F1.

Loading files

To abbreviate tedious input one may generate a file containing EULER input. This file can be generated with any editor. To load that file enter

    >load filename

All lines of that file are then interpreted just as any other input from the keyboard. Also a loaded file may itself contain a load command. If an error occurs, the loading is stopped and an error message is displayed. There is a default extension ".e", which you should use for your files. You need not specify this extension in the load command. The filename may be included in double quotes. If you are using a string expression, include it in round brackets.

EULER looks for the specified file in the active directory by default. You may specify a path with the path statement

    >path "..."

where the string should contain a path like ".;myspecial". This would put the active directory into the path and a subdirectory named myspecial. The path command is handy for network setups. The best use of a load file is to define functions in that file. EULER files should have the extension .E (e.g., DEMO.E).

A file may contain a comments. Comments look like this

comment
This is a comment.
Comments can spread several lines.

Also empty lines are allowed.
endcomment

endcomment must be the first string of a line.

You can turn comment printing off with

comment off

Otherwise all comments in a file are displayed, when the file is loaded.

comment on

turns this feature on.

Euler Errors

If a computational error occurs, Euler will issue an error message and try to print the offending input. This may either be a place in your line input, in a loaded file or a line in an Euler function. In the latter case, Euler will print a stack dump of Euler function calls.

You can generate an error yourself and print an error message with

error("An error occured");

If this line is in an Euler function, execution will be stopped, and the normal error routine is called, generating a stack dump.

It is also possible to test an expression for errors. This will not generate error messages (indeed it will surpress all output), and return an error code and, if available, a result. An example is

{n,B}=errorlevel("inv(A)");

The matrix A will be inverted to B, if possible, and n will contain 0. If the inversion fails, n will contain an error number different from 0. The variable B may not be used in this case. Use

if n<>0; error("Inversion failed"); endif;

to test for an error.