File: commandline.html

package info (click to toggle)
euler 1.61.0-12
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid, trixie
  • size: 5,164 kB
  • sloc: ansic: 24,761; sh: 8,314; makefile: 141; cpp: 47; php: 1
file content (153 lines) | stat: -rw-r--r-- 9,143 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>

<HEAD>
	<META HTTP-EQUIV="Content-Type" CONTENT="text/html;CHARSET=iso-8859-1">
<META NAME="VPSiteProject" CONTENT="file:///E|/euler/docs/Euler.vpp">

	<META NAME="GENERATOR" Content="Visual Page 2.0 for Windows">
	<TITLE>Basics</TITLE>
	<BASE target="_self">
	<LINK REL="stylesheet" TYPE="text/css" HREF="euler.css">
</HEAD>

<BODY>

<H1 ALIGN="CENTER">Basics</H1>
<P>Explains</P>

<UL>
	<LI><A HREF="#windows">the windows Euler uses</A>,
	<LI><A HREF="#Notebooks">the notebooks</A>,
	<LI><A HREF="#Command">the command line</A>,
	<LI><A HREF="#Loading">how to save commands and functions on files</A>,
	<LI><A HREF="#Errors">how to deal with errors</A>.
</UL>

<H2 ALIGN="CENTER">Using the EULER <A NAME="windows"></A>windows</H2>
<P>EULER uses two windows. The <EM>text window</EM> and the <EM>graphics window</EM>. In the Unix version, you
have to switch between them by pressing the TAB key, in GUI versions you can alternatively use the mouse, of course.</P>
<P>The text window contains the menu and is for user input and output of EULER. The graphics window is displayed,
whenever EULER draws output. The graphics screen is visible as long as there is no text output. In this case, EULER
pops the text screen to the forground.
<H2 ALIGN="CENTER"><A NAME="Notebooks"></A>Notebooks</H2>
<P>This applies only to the notebook versions of EULER. Notebooks contain the commands, comments and EULER 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 program files, which could be loaded as first command of a notebook. A notebook could accompany the definitions,
which explains the use of the functions with examples. Another idea is to use notbooks for teaching mathematics.</P>
<P>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.</P>
<P>You may not only change previous commands, but also delete them or insert new commands. Use the notebook menu
to do this, or the keyboard shortcuts. If you change a command and execute it, its output is removed and EULER
proceeds to the next command, unless you choose to insert all new commands. In this case, a new command is inserted
after the one, you just executed.</P>
<P>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 the selected commands will be deleted.</P>
<H2 ALIGN="CENTER">Notebooks in old versions of EULER</H2>
<P>Notebooks can be loaded from all versions of EULER. However, you cannot edit them. Use</P>
<PRE>    &gt;notebook filename
</PRE>
<P>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</P>
<PRE>    &gt;prompt off</PRE>
<P>
<H2 ALIGN="CENTER">The <A NAME="Command"></A>Command Line</H2>
<P>Text can be entered after the prompt (&gt;) 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. The Home and End keys work as usual. Escape clears
all input. Shift plus -&gt; or&lt; - 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.</P>
<P>Previous input can be re-called 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.</P>
<P>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.</P>
<P>The End key will insert the text &quot;endfunction&quot;, but only on empty lines in porgramming mode (see below).
Otherwise, it works as usual.</P>
<P>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.</P>
<P>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.</P>
<P>Input can spread over several lines by the use of &quot;..&quot;. The two dots are allowed at any place, where
a space is acceptable. E.g.</P>
<PRE>    &gt;3+ .. some comment
    &gt;4
</PRE>
<P>is equivalent to</P>
<PRE>    &gt;3+4
</PRE>
<P>Comments can follow the &quot;..&quot; and are skipped.</P>
<H3>Function Keys</H3>
<P>The function keys may be programmed by the command</P>
<PRE>    &gt;setkey(number,&quot;text&quot;);
</PRE>
<P>The number must be between 1 and 10 and the &quot;text&quot; 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 the &quot; character, one can use double quotes as string delimiters as in</P>
<PRE>    &gt;setkey(1,''load &quot;test&quot;;'');
</PRE>
<P>which puts</P>
<PRE>    &gt;load &quot;test&quot;;
</PRE>
<P>on the function key Shift-F1.
<H2 ALIGN="CENTER"><A NAME="Loading"></A>Loading files</H2>
<P>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</P>
<PRE>    &gt;load filename
</PRE>
<P>All lines of that file are 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 &quot;.e&quot;, which you should use for these 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.</P>
<P>The best use of an Euler program file is to define functions in that file. Many predefined functions are loaded
at each start of EULER. This works in the following way: EULER will load the file euler.cfg everytime the program
starts. This file does again contain load commands, which load the necessary utility files.</P>
<P>EULER looks for the specified file in the active directory by default. You may specify a path with the path
statement</P>
<PRE>    &gt;path &quot;...&quot;
</PRE>
<P>where the string should contain a path like &quot;.;myspecial&quot;. This would put the active directory into
the path and a subdirectory named myspecial. The path command is handy for network setups.</P>
<P>A file may contain a comments. Comments look like this</P>
<PRE>comment
This is a comment.
Comments can spread several lines.

Also empty lines are allowed.
endcomment
</PRE>
<P>endcomment must be the first string of a line.</P>
<P>You can turn comment printing off with</P>
<PRE>comment off
</PRE>
<P>Otherwise all comments in a file are displayed, when the file is loaded.</P>
<PRE>comment on
</PRE>
<P>turns this feature on.</P>
<H2 ALIGN="CENTER">Euler <A NAME="Errors"></A>Errors</H2>
<P>If a computation error occurs, Euler will issue an error message and try to print the offending input. This
may either be a place in your input from the command line, a command line in a loaded file, or a line in an EULER
function. In the latter case, Euler will print a stack dump of function calls.</P>
<P>You can generate an error yourself and print an error message with</P>
<PRE>error(&quot;An error occured&quot;);</PRE>
<P>If this line is in an Euler function, execution will be stopped, and the normal error routine is called, generating
a stack dump.</P>
<P>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</P>
<PRE>{n,B}=errorlevel(&quot;inv(A)&quot;);
</PRE>
<P>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</P>
<PRE>if n&lt;&gt;0; error(&quot;Inversion failed&quot;); endif;</PRE>
<P>to test for an error.

</BODY>

</HTML>