Mercurial > octave-nkf
annotate doc/interpreter/basics.txi @ 18153:5971c8f515a7 gui-release
doc: Document options set when using --traditional.
* basics.txi: Document options set when using --traditional.
author | Rik <rik@octave.org> |
---|---|
date | Thu, 19 Dec 2013 17:32:38 -0800 |
parents | 344f15ecfbb6 |
children | dc64f1c4a33e fe689210525c |
rev | line source |
---|---|
17744
d63878346099
maint: Update copyright notices for release.
John W. Eaton <jwe@octave.org>
parents:
17281
diff
changeset
|
1 @c Copyright (C) 1996-2013 John W. Eaton |
7018 | 2 @c |
3 @c This file is part of Octave. | |
4 @c | |
5 @c Octave is free software; you can redistribute it and/or modify it | |
6 @c under the terms of the GNU General Public License as published by the | |
7 @c Free Software Foundation; either version 3 of the License, or (at | |
8 @c your option) any later version. | |
9 @c | |
10 @c Octave is distributed in the hope that it will be useful, but WITHOUT | |
11 @c ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
12 @c FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
13 @c for more details. | |
14 @c | |
15 @c You should have received a copy of the GNU General Public License | |
16 @c along with Octave; see the file COPYING. If not, see | |
17 @c <http://www.gnu.org/licenses/>. | |
3294 | 18 |
4167 | 19 @node Getting Started |
3294 | 20 @chapter Getting Started |
21 | |
22 This chapter explains some of Octave's basic features, including how to | |
23 start an Octave session, get help at the command prompt, edit the | |
24 command line, and write Octave programs that can be executed as commands | |
25 from your shell. | |
26 | |
27 @menu | |
17152
f2a8592b8fbd
doc: Shorten some long subsection names in Manual.
Rik <rik@octave.org>
parents:
17097
diff
changeset
|
28 * Invoking Octave from the Command Line:: |
f2a8592b8fbd
doc: Shorten some long subsection names in Manual.
Rik <rik@octave.org>
parents:
17097
diff
changeset
|
29 * Quitting Octave:: |
f2a8592b8fbd
doc: Shorten some long subsection names in Manual.
Rik <rik@octave.org>
parents:
17097
diff
changeset
|
30 * Getting Help:: |
f2a8592b8fbd
doc: Shorten some long subsection names in Manual.
Rik <rik@octave.org>
parents:
17097
diff
changeset
|
31 * Command Line Editing:: |
f2a8592b8fbd
doc: Shorten some long subsection names in Manual.
Rik <rik@octave.org>
parents:
17097
diff
changeset
|
32 * Errors:: |
f2a8592b8fbd
doc: Shorten some long subsection names in Manual.
Rik <rik@octave.org>
parents:
17097
diff
changeset
|
33 * Executable Octave Programs:: |
f2a8592b8fbd
doc: Shorten some long subsection names in Manual.
Rik <rik@octave.org>
parents:
17097
diff
changeset
|
34 * Comments:: |
3294 | 35 @end menu |
36 | |
6620 | 37 @node Invoking Octave from the Command Line |
38 @section Invoking Octave from the Command Line | |
3294 | 39 |
40 Normally, Octave is used interactively by running the program | |
41 @samp{octave} without any arguments. Once started, Octave reads | |
42 commands from the terminal until you tell it to exit. | |
43 | |
44 You can also specify the name of a file on the command line, and Octave | |
45 will read and execute the commands from the named file and then exit | |
46 when it is finished. | |
47 | |
48 You can further control how Octave starts by using the command-line | |
49 options described in the next section, and Octave itself can remind you | |
50 of the options available. Type @samp{octave --help} to display all | |
51 available options and briefly describe their use (@samp{octave -h} is a | |
52 shorter equivalent). | |
53 | |
54 @menu | |
17152
f2a8592b8fbd
doc: Shorten some long subsection names in Manual.
Rik <rik@octave.org>
parents:
17097
diff
changeset
|
55 * Command Line Options:: |
f2a8592b8fbd
doc: Shorten some long subsection names in Manual.
Rik <rik@octave.org>
parents:
17097
diff
changeset
|
56 * Startup Files:: |
3294 | 57 @end menu |
58 | |
4167 | 59 @node Command Line Options |
3294 | 60 @subsection Command Line Options |
61 @cindex Octave command options | |
62 @cindex command options | |
63 @cindex options, Octave command | |
64 | |
9132
eb1747dbd360
Update help strings for command line options
Rik <rdrider0-list@yahoo.com>
parents:
9051
diff
changeset
|
65 Here is a complete list of the command line options that Octave |
3294 | 66 accepts. |
67 | |
6620 | 68 |
3294 | 69 @table @code |
16807
2fd22fbaffa3
doc: Add built_in_docstrings_file() to documentation.
Rik <rik@octave.org>
parents:
16774
diff
changeset
|
70 |
2fd22fbaffa3
doc: Add built_in_docstrings_file() to documentation.
Rik <rik@octave.org>
parents:
16774
diff
changeset
|
71 @item --built-in-docstrings-file @var{filename} |
2fd22fbaffa3
doc: Add built_in_docstrings_file() to documentation.
Rik <rik@octave.org>
parents:
16774
diff
changeset
|
72 @cindex @code{--built-in-docstrings-file @var{filename}} |
2fd22fbaffa3
doc: Add built_in_docstrings_file() to documentation.
Rik <rik@octave.org>
parents:
16774
diff
changeset
|
73 Specify the name of the file containing documentation strings for the |
2fd22fbaffa3
doc: Add built_in_docstrings_file() to documentation.
Rik <rik@octave.org>
parents:
16774
diff
changeset
|
74 built-in functions of Octave. This value is normally correct and should |
2fd22fbaffa3
doc: Add built_in_docstrings_file() to documentation.
Rik <rik@octave.org>
parents:
16774
diff
changeset
|
75 only need to specified in extraordinary situations. |
2fd22fbaffa3
doc: Add built_in_docstrings_file() to documentation.
Rik <rik@octave.org>
parents:
16774
diff
changeset
|
76 |
9132
eb1747dbd360
Update help strings for command line options
Rik <rdrider0-list@yahoo.com>
parents:
9051
diff
changeset
|
77 @item --debug |
3294 | 78 @itemx -d |
79 @cindex @code{--debug} | |
80 @cindex @code{-d} | |
81 Enter parser debugging mode. Using this option will cause Octave's | |
82 parser to print a lot of information about the commands it reads, and is | |
83 probably only useful if you are actually trying to debug the parser. | |
84 | |
16877
5482cd26311a
Rename enable_jit_compiler to jit_enable, enable_jit_debugging to debug_jit.
Rik <rik@octave.org>
parents:
16876
diff
changeset
|
85 @item --debug-jit |
5482cd26311a
Rename enable_jit_compiler to jit_enable, enable_jit_debugging to debug_jit.
Rik <rik@octave.org>
parents:
16876
diff
changeset
|
86 @cindex @code{--debug-jit} |
5482cd26311a
Rename enable_jit_compiler to jit_enable, enable_jit_debugging to debug_jit.
Rik <rik@octave.org>
parents:
16876
diff
changeset
|
87 Enable JIT compiler debugging and tracing. |
5482cd26311a
Rename enable_jit_compiler to jit_enable, enable_jit_debugging to debug_jit.
Rik <rik@octave.org>
parents:
16876
diff
changeset
|
88 |
16807
2fd22fbaffa3
doc: Add built_in_docstrings_file() to documentation.
Rik <rik@octave.org>
parents:
16774
diff
changeset
|
89 @item --doc-cache-file @var{filename} |
2fd22fbaffa3
doc: Add built_in_docstrings_file() to documentation.
Rik <rik@octave.org>
parents:
16774
diff
changeset
|
90 @cindex @code{--doc-cache-file @var{filename}} |
8923
d47290508a55
document --doc-cache-file option
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
91 Specify the name of the doc cache file to use. The value of @var{filename} |
d47290508a55
document --doc-cache-file option
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
92 specified on the command line will override any value of |
10828
322f43e0e170
Grammarcheck .txi documentation files.
Rik <octave@nomad.inbox5.com>
parents:
10613
diff
changeset
|
93 @w{@env{OCTAVE_DOC_CACHE_FILE}} found in the environment, but not any commands |
9132
eb1747dbd360
Update help strings for command line options
Rik <rdrider0-list@yahoo.com>
parents:
9051
diff
changeset
|
94 in the system or user startup files that use the @code{doc_cache_file} |
8923
d47290508a55
document --doc-cache-file option
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
95 function. |
d47290508a55
document --doc-cache-file option
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
96 |
9132
eb1747dbd360
Update help strings for command line options
Rik <rdrider0-list@yahoo.com>
parents:
9051
diff
changeset
|
97 @item --echo-commands |
3294 | 98 @itemx -x |
99 @cindex @code{--echo-commands} | |
100 @cindex @code{-x} | |
101 Echo commands as they are executed. | |
102 | |
5190 | 103 @item --eval @var{code} |
10828
322f43e0e170
Grammarcheck .txi documentation files.
Rik <octave@nomad.inbox5.com>
parents:
10613
diff
changeset
|
104 Evaluate @var{code} and exit when finished unless @option{--persist} is also |
5190 | 105 specified. |
106 | |
3294 | 107 @item --exec-path @var{path} |
108 @cindex @code{--exec-path @var{path}} | |
109 Specify the path to search for programs to run. The value of @var{path} | |
110 specified on the command line will override any value of | |
10828
322f43e0e170
Grammarcheck .txi documentation files.
Rik <octave@nomad.inbox5.com>
parents:
10613
diff
changeset
|
111 @w{@env{OCTAVE_EXEC_PATH}} found in the environment, but not any commands |
3294 | 112 in the system or user startup files that set the built-in variable |
10828
322f43e0e170
Grammarcheck .txi documentation files.
Rik <octave@nomad.inbox5.com>
parents:
10613
diff
changeset
|
113 @w{@env{EXEC_PATH}}. |
3294 | 114 |
15540
d8e3111b1890
doc: Add documentation about new command-line options available.
Rik <rik@octave.org>
parents:
14856
diff
changeset
|
115 @item --force-gui |
d8e3111b1890
doc: Add documentation about new command-line options available.
Rik <rik@octave.org>
parents:
14856
diff
changeset
|
116 @cindex @code{--force-gui} |
d8e3111b1890
doc: Add documentation about new command-line options available.
Rik <rik@octave.org>
parents:
14856
diff
changeset
|
117 Force the graphical user interface (GUI) to start. |
d8e3111b1890
doc: Add documentation about new command-line options available.
Rik <rik@octave.org>
parents:
14856
diff
changeset
|
118 |
9132
eb1747dbd360
Update help strings for command line options
Rik <rdrider0-list@yahoo.com>
parents:
9051
diff
changeset
|
119 @item --help |
3294 | 120 @itemx -h |
121 @itemx -? | |
122 @cindex @code{--help} | |
123 @cindex @code{-h} | |
124 @cindex @code{-?} | |
125 Print short help message and exit. | |
126 | |
6620 | 127 @item --image-path @var{path} |
128 @cindex @code{--image-path @var{path}} | |
9132
eb1747dbd360
Update help strings for command line options
Rik <rdrider0-list@yahoo.com>
parents:
9051
diff
changeset
|
129 Add path to the head of the search path for images. The value of |
eb1747dbd360
Update help strings for command line options
Rik <rdrider0-list@yahoo.com>
parents:
9051
diff
changeset
|
130 @var{path} specified on the command line will override any value of |
10828
322f43e0e170
Grammarcheck .txi documentation files.
Rik <octave@nomad.inbox5.com>
parents:
10613
diff
changeset
|
131 @w{@env{OCTAVE_IMAGE_PATH}} found in the environment, but not any commands |
9132
eb1747dbd360
Update help strings for command line options
Rik <rdrider0-list@yahoo.com>
parents:
9051
diff
changeset
|
132 in the system or user startup files that set the built-in variable |
10828
322f43e0e170
Grammarcheck .txi documentation files.
Rik <octave@nomad.inbox5.com>
parents:
10613
diff
changeset
|
133 @w{@env{IMAGE_PATH}}. |
6620 | 134 |
3294 | 135 @item --info-file @var{filename} |
136 @cindex @code{--info-file @var{filename}} | |
137 Specify the name of the info file to use. The value of @var{filename} | |
138 specified on the command line will override any value of | |
10828
322f43e0e170
Grammarcheck .txi documentation files.
Rik <octave@nomad.inbox5.com>
parents:
10613
diff
changeset
|
139 @w{@env{OCTAVE_INFO_FILE}} found in the environment, but not any commands |
6653 | 140 in the system or user startup files that use the @code{info_file} |
6477 | 141 function. |
3294 | 142 |
143 @item --info-program @var{program} | |
144 @cindex @code{--info-program @var{program}} | |
145 Specify the name of the info program to use. The value of @var{program} | |
146 specified on the command line will override any value of | |
10828
322f43e0e170
Grammarcheck .txi documentation files.
Rik <octave@nomad.inbox5.com>
parents:
10613
diff
changeset
|
147 @w{@env{OCTAVE_INFO_PROGRAM}} found in the environment, but not any |
6477 | 148 commands in the system or user startup files that use the |
149 @code{info_program} function. | |
3294 | 150 |
9132
eb1747dbd360
Update help strings for command line options
Rik <rdrider0-list@yahoo.com>
parents:
9051
diff
changeset
|
151 @item --interactive |
3294 | 152 @itemx -i |
153 @cindex @code{--interactive} | |
154 @cindex @code{-i} | |
155 Force interactive behavior. This can be useful for running Octave via a | |
156 remote shell command or inside an Emacs shell buffer. For another way | |
17097
e7a059a9a644
doc: Use XREF as anchor prefix in documentation for clearer results in Info viewer.
Rik <rik@octave.org>
parents:
16880
diff
changeset
|
157 to run Octave within Emacs, @pxref{Emacs Octave Support}. |
3294 | 158 |
17793
344f15ecfbb6
doc: Document --jit-compiler option in manual.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
159 @item --jit-compiler |
344f15ecfbb6
doc: Document --jit-compiler option in manual.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
160 @cindex @code{--jit-compiler} |
344f15ecfbb6
doc: Document --jit-compiler option in manual.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
161 Enable the JIT compiler used for accelerating loops. |
344f15ecfbb6
doc: Document --jit-compiler option in manual.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
162 |
9132
eb1747dbd360
Update help strings for command line options
Rik <rdrider0-list@yahoo.com>
parents:
9051
diff
changeset
|
163 @item --line-editing |
eb1747dbd360
Update help strings for command line options
Rik <rdrider0-list@yahoo.com>
parents:
9051
diff
changeset
|
164 @cindex @code{--line-editing} |
eb1747dbd360
Update help strings for command line options
Rik <rdrider0-list@yahoo.com>
parents:
9051
diff
changeset
|
165 Force readline use for command-line editing. |
eb1747dbd360
Update help strings for command line options
Rik <rdrider0-list@yahoo.com>
parents:
9051
diff
changeset
|
166 |
15540
d8e3111b1890
doc: Add documentation about new command-line options available.
Rik <rik@octave.org>
parents:
14856
diff
changeset
|
167 @item --no-gui |
d8e3111b1890
doc: Add documentation about new command-line options available.
Rik <rik@octave.org>
parents:
14856
diff
changeset
|
168 @cindex @code{--no-gui} |
d8e3111b1890
doc: Add documentation about new command-line options available.
Rik <rik@octave.org>
parents:
14856
diff
changeset
|
169 Disable the graphical user interface (GUI) and use the command line |
d8e3111b1890
doc: Add documentation about new command-line options available.
Rik <rik@octave.org>
parents:
14856
diff
changeset
|
170 interface (CLI) instead. |
d8e3111b1890
doc: Add documentation about new command-line options available.
Rik <rik@octave.org>
parents:
14856
diff
changeset
|
171 |
9132
eb1747dbd360
Update help strings for command line options
Rik <rdrider0-list@yahoo.com>
parents:
9051
diff
changeset
|
172 @item --no-history |
3428 | 173 @itemx -H |
9132
eb1747dbd360
Update help strings for command line options
Rik <rdrider0-list@yahoo.com>
parents:
9051
diff
changeset
|
174 @cindex @code{--no-history} |
eb1747dbd360
Update help strings for command line options
Rik <rdrider0-list@yahoo.com>
parents:
9051
diff
changeset
|
175 @cindex @code{-H} |
eb1747dbd360
Update help strings for command line options
Rik <rdrider0-list@yahoo.com>
parents:
9051
diff
changeset
|
176 Disable recording of command-line history. |
3428 | 177 |
3294 | 178 @item --no-init-file |
179 @cindex @code{--no-init-file} | |
9132
eb1747dbd360
Update help strings for command line options
Rik <rdrider0-list@yahoo.com>
parents:
9051
diff
changeset
|
180 Don't read the initialization files @file{~/.octaverc} and @file{.octaverc}. |
eb1747dbd360
Update help strings for command line options
Rik <rdrider0-list@yahoo.com>
parents:
9051
diff
changeset
|
181 |
eb1747dbd360
Update help strings for command line options
Rik <rdrider0-list@yahoo.com>
parents:
9051
diff
changeset
|
182 @item --no-init-path |
eb1747dbd360
Update help strings for command line options
Rik <rdrider0-list@yahoo.com>
parents:
9051
diff
changeset
|
183 @cindex @code{--no-init-path} |
eb1747dbd360
Update help strings for command line options
Rik <rdrider0-list@yahoo.com>
parents:
9051
diff
changeset
|
184 Don't initialize the search path for function files to include default |
eb1747dbd360
Update help strings for command line options
Rik <rdrider0-list@yahoo.com>
parents:
9051
diff
changeset
|
185 locations. |
3294 | 186 |
187 @item --no-line-editing | |
188 @cindex @code{--no-line-editing} | |
189 Disable command-line editing. | |
190 | |
191 @item --no-site-file | |
192 @cindex @code{--no-site-file} | |
9132
eb1747dbd360
Update help strings for command line options
Rik <rdrider0-list@yahoo.com>
parents:
9051
diff
changeset
|
193 Don't read the site-wide @file{octaverc} initialization files. |
3294 | 194 |
16774
8d188159ce5f
Add -W command line option to disable window system (bug #38937)
Rik <rik@octave.org>
parents:
16772
diff
changeset
|
195 @item --no-window-system |
8d188159ce5f
Add -W command line option to disable window system (bug #38937)
Rik <rik@octave.org>
parents:
16772
diff
changeset
|
196 @itemx -W |
15540
d8e3111b1890
doc: Add documentation about new command-line options available.
Rik <rik@octave.org>
parents:
14856
diff
changeset
|
197 @cindex @code{--no-window-system} |
d8e3111b1890
doc: Add documentation about new command-line options available.
Rik <rik@octave.org>
parents:
14856
diff
changeset
|
198 Disable use of a windowing system including graphics. This forces a |
d8e3111b1890
doc: Add documentation about new command-line options available.
Rik <rik@octave.org>
parents:
14856
diff
changeset
|
199 strictly terminal-only environment. |
d8e3111b1890
doc: Add documentation about new command-line options available.
Rik <rik@octave.org>
parents:
14856
diff
changeset
|
200 |
9132
eb1747dbd360
Update help strings for command line options
Rik <rdrider0-list@yahoo.com>
parents:
9051
diff
changeset
|
201 @item --norc |
3294 | 202 @itemx -f |
203 @cindex @code{--norc} | |
204 @cindex @code{-f} | |
205 Don't read any of the system or user initialization files at startup. | |
10828
322f43e0e170
Grammarcheck .txi documentation files.
Rik <octave@nomad.inbox5.com>
parents:
10613
diff
changeset
|
206 This is equivalent to using both of the options @option{--no-init-file} |
322f43e0e170
Grammarcheck .txi documentation files.
Rik <octave@nomad.inbox5.com>
parents:
10613
diff
changeset
|
207 and @option{--no-site-file}. |
3294 | 208 |
9132
eb1747dbd360
Update help strings for command line options
Rik <rdrider0-list@yahoo.com>
parents:
9051
diff
changeset
|
209 @item --path @var{path} |
3294 | 210 @itemx -p @var{path} |
211 @cindex @code{--path @var{path}} | |
212 @cindex @code{-p @var{path}} | |
9132
eb1747dbd360
Update help strings for command line options
Rik <rdrider0-list@yahoo.com>
parents:
9051
diff
changeset
|
213 Add path to the head of the search path for function files. The |
eb1747dbd360
Update help strings for command line options
Rik <rdrider0-list@yahoo.com>
parents:
9051
diff
changeset
|
214 value of @var{path} specified on the command line will override any value |
10828
322f43e0e170
Grammarcheck .txi documentation files.
Rik <octave@nomad.inbox5.com>
parents:
10613
diff
changeset
|
215 of @w{@env{OCTAVE_PATH}} found in the environment, but not any commands in the |
6643 | 216 system or user startup files that set the internal load path through one |
217 of the path functions. | |
3294 | 218 |
5190 | 219 @item --persist |
9132
eb1747dbd360
Update help strings for command line options
Rik <rdrider0-list@yahoo.com>
parents:
9051
diff
changeset
|
220 @cindex @code{--persist} |
10828
322f43e0e170
Grammarcheck .txi documentation files.
Rik <octave@nomad.inbox5.com>
parents:
10613
diff
changeset
|
221 Go to interactive mode after @option{--eval} or reading from a file |
5190 | 222 named on the command line. |
223 | |
9132
eb1747dbd360
Update help strings for command line options
Rik <rdrider0-list@yahoo.com>
parents:
9051
diff
changeset
|
224 @item --silent |
3294 | 225 @itemx --quiet |
226 @itemx -q | |
227 @cindex @code{--silent} | |
228 @cindex @code{--quiet} | |
229 @cindex @code{-q} | |
230 Don't print the usual greeting and version message at startup. | |
231 | |
15540
d8e3111b1890
doc: Add documentation about new command-line options available.
Rik <rik@octave.org>
parents:
14856
diff
changeset
|
232 @item --texi-macros-file @var{filename} |
d8e3111b1890
doc: Add documentation about new command-line options available.
Rik <rik@octave.org>
parents:
14856
diff
changeset
|
233 @cindex @code{--texi-macros-file @var{filename}} |
d8e3111b1890
doc: Add documentation about new command-line options available.
Rik <rik@octave.org>
parents:
14856
diff
changeset
|
234 Specify the name of the file containing Texinfo macros for use by makeinfo. |
d8e3111b1890
doc: Add documentation about new command-line options available.
Rik <rik@octave.org>
parents:
14856
diff
changeset
|
235 |
9132
eb1747dbd360
Update help strings for command line options
Rik <rdrider0-list@yahoo.com>
parents:
9051
diff
changeset
|
236 @item --traditional |
3294 | 237 @itemx --braindead |
238 @cindex @code{--traditional} | |
239 @cindex @code{--braindead} | |
9051
1bf0ce0930be
Grammar check TexInfo in all .m files
Rik <rdrider0-list@yahoo.com>
parents:
9035
diff
changeset
|
240 For compatibility with @sc{matlab}, set initial values for |
9035
57649dcecb55
Documentation cleanup of basics.texi
Rik <rdrider0-list@yahoo.com>
parents:
9032
diff
changeset
|
241 user preferences to the following values |
3294 | 242 |
243 @example | |
4455 | 244 @group |
10613
e103fb2182ce
use internal variable instead of warning state to control whether to allow non-integer ranges as indices
John W. Eaton <jwe@octave.org>
parents:
9906
diff
changeset
|
245 PS1 = ">> " |
e103fb2182ce
use internal variable instead of warning state to control whether to allow non-integer ranges as indices
John W. Eaton <jwe@octave.org>
parents:
9906
diff
changeset
|
246 PS2 = "" |
e103fb2182ce
use internal variable instead of warning state to control whether to allow non-integer ranges as indices
John W. Eaton <jwe@octave.org>
parents:
9906
diff
changeset
|
247 beep_on_error = true |
e103fb2182ce
use internal variable instead of warning state to control whether to allow non-integer ranges as indices
John W. Eaton <jwe@octave.org>
parents:
9906
diff
changeset
|
248 confirm_recursive_rmdir = false |
e103fb2182ce
use internal variable instead of warning state to control whether to allow non-integer ranges as indices
John W. Eaton <jwe@octave.org>
parents:
9906
diff
changeset
|
249 crash_dumps_octave_core = false |
16875
b04ae15530fc
Rename default_save_options() to save_default_options().
Rik <rik@octave.org>
parents:
16872
diff
changeset
|
250 save_default_options = "-mat-binary" |
10613
e103fb2182ce
use internal variable instead of warning state to control whether to allow non-integer ranges as indices
John W. Eaton <jwe@octave.org>
parents:
9906
diff
changeset
|
251 fixed_point_format = true |
e103fb2182ce
use internal variable instead of warning state to control whether to allow non-integer ranges as indices
John W. Eaton <jwe@octave.org>
parents:
9906
diff
changeset
|
252 history_timestamp_format_string = "%%-- %D %I:%M %p --%%" |
e103fb2182ce
use internal variable instead of warning state to control whether to allow non-integer ranges as indices
John W. Eaton <jwe@octave.org>
parents:
9906
diff
changeset
|
253 page_screen_output = false |
e103fb2182ce
use internal variable instead of warning state to control whether to allow non-integer ranges as indices
John W. Eaton <jwe@octave.org>
parents:
9906
diff
changeset
|
254 print_empty_dimensions = false |
18153
5971c8f515a7
doc: Document options set when using --traditional.
Rik <rik@octave.org>
parents:
17793
diff
changeset
|
255 struct_levels_to_print = 0 |
6556 | 256 @end group |
257 @end example | |
258 | |
259 @noindent | |
260 and disable the following warnings | |
10828
322f43e0e170
Grammarcheck .txi documentation files.
Rik <octave@nomad.inbox5.com>
parents:
10613
diff
changeset
|
261 |
6556 | 262 @example |
263 @group | |
10613
e103fb2182ce
use internal variable instead of warning state to control whether to allow non-integer ranges as indices
John W. Eaton <jwe@octave.org>
parents:
9906
diff
changeset
|
264 Octave:abbreviated-property-match |
7031 | 265 Octave:fopen-file-in-path |
266 Octave:function-name-clash | |
267 Octave:load-file-in-path | |
18153
5971c8f515a7
doc: Document options set when using --traditional.
Rik <rik@octave.org>
parents:
17793
diff
changeset
|
268 Octave:possible-matlab-short-circuit-operator |
4455 | 269 @end group |
3294 | 270 @end example |
271 | |
15618
9aa8dcf1e93d
doc: cross-reference Octave:matlab-incompatible to --braindead and --traditional
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
15545
diff
changeset
|
272 @noindent |
9aa8dcf1e93d
doc: cross-reference Octave:matlab-incompatible to --braindead and --traditional
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
15545
diff
changeset
|
273 Note that this does not enable the @code{Octave:matlab-incompatible} |
9aa8dcf1e93d
doc: cross-reference Octave:matlab-incompatible to --braindead and --traditional
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
15545
diff
changeset
|
274 warning, which you might want if you want to be told about writing code |
17097
e7a059a9a644
doc: Use XREF as anchor prefix in documentation for clearer results in Info viewer.
Rik <rik@octave.org>
parents:
16880
diff
changeset
|
275 that works in Octave but not @sc{matlab} (@pxref{XREFwarning,,warning}, |
e7a059a9a644
doc: Use XREF as anchor prefix in documentation for clearer results in Info viewer.
Rik <rik@octave.org>
parents:
16880
diff
changeset
|
276 @ref{XREFwarning_ids,,warning_ids}). |
15618
9aa8dcf1e93d
doc: cross-reference Octave:matlab-incompatible to --braindead and --traditional
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
15545
diff
changeset
|
277 |
9132
eb1747dbd360
Update help strings for command line options
Rik <rdrider0-list@yahoo.com>
parents:
9051
diff
changeset
|
278 @item --verbose |
3294 | 279 @itemx -V |
280 @cindex @code{--verbose} | |
281 @cindex @code{-V} | |
282 Turn on verbose output. | |
283 | |
9132
eb1747dbd360
Update help strings for command line options
Rik <rdrider0-list@yahoo.com>
parents:
9051
diff
changeset
|
284 @item --version |
3294 | 285 @itemx -v |
286 @cindex @code{--version} | |
287 @cindex @code{-v} | |
288 Print the program version number and exit. | |
289 | |
290 @item @var{file} | |
5190 | 291 Execute commands from @var{file}. Exit when done unless |
10828
322f43e0e170
Grammarcheck .txi documentation files.
Rik <octave@nomad.inbox5.com>
parents:
10613
diff
changeset
|
292 @option{--persist} is also specified. |
3294 | 293 @end table |
294 | |
9132
eb1747dbd360
Update help strings for command line options
Rik <rdrider0-list@yahoo.com>
parents:
9051
diff
changeset
|
295 Octave also includes several functions which return information |
3294 | 296 about the command line, including the number of arguments and all of the |
297 options. | |
298 | |
3332 | 299 @DOCSTRING(argv) |
3294 | 300 |
6550 | 301 @DOCSTRING(program_name) |
302 | |
3332 | 303 @DOCSTRING(program_invocation_name) |
3294 | 304 |
9132
eb1747dbd360
Update help strings for command line options
Rik <rdrider0-list@yahoo.com>
parents:
9051
diff
changeset
|
305 Here is an example of using these functions to reproduce the command |
eb1747dbd360
Update help strings for command line options
Rik <rdrider0-list@yahoo.com>
parents:
9051
diff
changeset
|
306 line which invoked Octave. |
3294 | 307 |
308 @example | |
9132
eb1747dbd360
Update help strings for command line options
Rik <rdrider0-list@yahoo.com>
parents:
9051
diff
changeset
|
309 @group |
6479 | 310 printf ("%s", program_name ()); |
6620 | 311 arg_list = argv (); |
3294 | 312 for i = 1:nargin |
6479 | 313 printf (" %s", arg_list@{i@}); |
3294 | 314 endfor |
315 printf ("\n"); | |
9132
eb1747dbd360
Update help strings for command line options
Rik <rdrider0-list@yahoo.com>
parents:
9051
diff
changeset
|
316 @end group |
3294 | 317 @end example |
318 | |
319 @noindent | |
9132
eb1747dbd360
Update help strings for command line options
Rik <rdrider0-list@yahoo.com>
parents:
9051
diff
changeset
|
320 @xref{Indexing Cell Arrays}, for an explanation of how to retrieve objects |
eb1747dbd360
Update help strings for command line options
Rik <rdrider0-list@yahoo.com>
parents:
9051
diff
changeset
|
321 from cell arrays, and @ref{Defining Functions}, for information about the |
eb1747dbd360
Update help strings for command line options
Rik <rdrider0-list@yahoo.com>
parents:
9051
diff
changeset
|
322 variable @code{nargin}. |
3294 | 323 |
4167 | 324 @node Startup Files |
3294 | 325 @subsection Startup Files |
326 @cindex initialization | |
327 @cindex startup | |
328 | |
6620 | 329 When Octave starts, it looks for commands to execute from the files in |
9035
57649dcecb55
Documentation cleanup of basics.texi
Rik <rdrider0-list@yahoo.com>
parents:
9032
diff
changeset
|
330 the following list. These files may contain any valid Octave commands, |
6620 | 331 including function definitions. |
3294 | 332 |
333 @cindex startup files | |
334 | |
335 @table @code | |
336 @item @var{octave-home}/share/octave/site/m/startup/octaverc | |
9132
eb1747dbd360
Update help strings for command line options
Rik <rdrider0-list@yahoo.com>
parents:
9051
diff
changeset
|
337 @cindex site startup file |
eb1747dbd360
Update help strings for command line options
Rik <rdrider0-list@yahoo.com>
parents:
9051
diff
changeset
|
338 where @var{octave-home} is the directory in which Octave is installed |
9906 | 339 (the default is @file{/usr/local}). |
9132
eb1747dbd360
Update help strings for command line options
Rik <rdrider0-list@yahoo.com>
parents:
9051
diff
changeset
|
340 This file is provided so that changes to the default Octave environment |
eb1747dbd360
Update help strings for command line options
Rik <rdrider0-list@yahoo.com>
parents:
9051
diff
changeset
|
341 can be made globally for all users at your site for all versions of Octave |
eb1747dbd360
Update help strings for command line options
Rik <rdrider0-list@yahoo.com>
parents:
9051
diff
changeset
|
342 you have installed. Care should be taken when making changes to this file |
eb1747dbd360
Update help strings for command line options
Rik <rdrider0-list@yahoo.com>
parents:
9051
diff
changeset
|
343 since all users of Octave at your site will be affected. The default file |
10828
322f43e0e170
Grammarcheck .txi documentation files.
Rik <octave@nomad.inbox5.com>
parents:
10613
diff
changeset
|
344 may be overridden by the environment variable @w{@env{OCTAVE_SITE_INITFILE}}. |
3294 | 345 |
346 @item @var{octave-home}/share/octave/@var{version}/m/startup/octaverc | |
9132
eb1747dbd360
Update help strings for command line options
Rik <rdrider0-list@yahoo.com>
parents:
9051
diff
changeset
|
347 @cindex version startup file |
eb1747dbd360
Update help strings for command line options
Rik <rdrider0-list@yahoo.com>
parents:
9051
diff
changeset
|
348 where @var{octave-home} is the directory in which Octave is |
9906 | 349 installed (the default is @file{/usr/local}), and @var{version} |
3294 | 350 is the version number of Octave. This file is provided so that changes |
9132
eb1747dbd360
Update help strings for command line options
Rik <rdrider0-list@yahoo.com>
parents:
9051
diff
changeset
|
351 to the default Octave environment can be made globally for all users of |
eb1747dbd360
Update help strings for command line options
Rik <rdrider0-list@yahoo.com>
parents:
9051
diff
changeset
|
352 a particular version of Octave. Care should be taken when making |
eb1747dbd360
Update help strings for command line options
Rik <rdrider0-list@yahoo.com>
parents:
9051
diff
changeset
|
353 changes to this file since all users of Octave at your site will be |
eb1747dbd360
Update help strings for command line options
Rik <rdrider0-list@yahoo.com>
parents:
9051
diff
changeset
|
354 affected. The default file may be overridden by the environment variable |
10828
322f43e0e170
Grammarcheck .txi documentation files.
Rik <octave@nomad.inbox5.com>
parents:
10613
diff
changeset
|
355 @w{@env{OCTAVE_VERSION_INITFILE}}. |
3294 | 356 |
357 @item ~/.octaverc | |
9132
eb1747dbd360
Update help strings for command line options
Rik <rdrider0-list@yahoo.com>
parents:
9051
diff
changeset
|
358 @cindex personal startup file |
3294 | 359 @cindex @code{~/.octaverc} |
9035
57649dcecb55
Documentation cleanup of basics.texi
Rik <rdrider0-list@yahoo.com>
parents:
9032
diff
changeset
|
360 This file is used to make personal changes to the default |
3294 | 361 Octave environment. |
362 | |
363 @item .octaverc | |
9132
eb1747dbd360
Update help strings for command line options
Rik <rdrider0-list@yahoo.com>
parents:
9051
diff
changeset
|
364 @cindex project startup file |
3294 | 365 @cindex @code{.octaverc} |
366 This file can be used to make changes to the default Octave environment | |
367 for a particular project. Octave searches for this file in the current | |
368 directory after it reads @file{~/.octaverc}. Any use of the @code{cd} | |
9035
57649dcecb55
Documentation cleanup of basics.texi
Rik <rdrider0-list@yahoo.com>
parents:
9032
diff
changeset
|
369 command in the @file{~/.octaverc} file will affect the directory where |
57649dcecb55
Documentation cleanup of basics.texi
Rik <rdrider0-list@yahoo.com>
parents:
9032
diff
changeset
|
370 Octave searches for @file{.octaverc}. |
3294 | 371 |
8347
fa78cb8d8a5c
corrections for typos
Brian Gough<bjg@network-theory.co.uk>
parents:
8015
diff
changeset
|
372 If you start Octave in your home directory, commands from the file |
3294 | 373 @file{~/.octaverc} will only be executed once. |
374 @end table | |
375 | |
376 A message will be displayed as each of the startup files is read if you | |
10828
322f43e0e170
Grammarcheck .txi documentation files.
Rik <octave@nomad.inbox5.com>
parents:
10613
diff
changeset
|
377 invoke Octave with the @option{--verbose} option but without the |
322f43e0e170
Grammarcheck .txi documentation files.
Rik <octave@nomad.inbox5.com>
parents:
10613
diff
changeset
|
378 @option{--silent} option. |
3294 | 379 |
12527
30ee8f0cc7c2
Add dump_prefs to documentation.
Rik <octave@nomad.inbox5.com>
parents:
12519
diff
changeset
|
380 The @code{dump_prefs} function is useful for determining what customizations |
30ee8f0cc7c2
Add dump_prefs to documentation.
Rik <octave@nomad.inbox5.com>
parents:
12519
diff
changeset
|
381 to Octave are possible and which are in effect. |
30ee8f0cc7c2
Add dump_prefs to documentation.
Rik <octave@nomad.inbox5.com>
parents:
12519
diff
changeset
|
382 |
30ee8f0cc7c2
Add dump_prefs to documentation.
Rik <octave@nomad.inbox5.com>
parents:
12519
diff
changeset
|
383 @DOCSTRING(dump_prefs) |
30ee8f0cc7c2
Add dump_prefs to documentation.
Rik <octave@nomad.inbox5.com>
parents:
12519
diff
changeset
|
384 |
4167 | 385 @node Quitting Octave |
3294 | 386 @section Quitting Octave |
387 @cindex exiting octave | |
388 @cindex quitting octave | |
389 | |
3332 | 390 @DOCSTRING(quit) |
3294 | 391 |
3332 | 392 @DOCSTRING(atexit) |
3294 | 393 |
4167 | 394 @node Getting Help |
3294 | 395 @section Commands for Getting Help |
15544
6a4e79110857
doc: Replace 'on-line' with modern 'online' in documentation and messages.
Rik <rik@octave.org>
parents:
14138
diff
changeset
|
396 @cindex online help |
6a4e79110857
doc: Replace 'on-line' with modern 'online' in documentation and messages.
Rik <rik@octave.org>
parents:
14138
diff
changeset
|
397 @cindex help, online |
3294 | 398 |
399 The entire text of this manual is available from the Octave prompt | |
6620 | 400 via the command @kbd{doc}. In addition, the documentation for |
3294 | 401 individual user-written functions and variables is also available via |
402 the @kbd{help} command. This section describes the commands used for | |
403 reading the manual and the documentation strings for user-supplied | |
404 functions and variables. @xref{Function Files}, for more information | |
405 about how to document the functions you write. | |
406 | |
3332 | 407 @DOCSTRING(help) |
3294 | 408 |
6549 | 409 @DOCSTRING(doc) |
410 | |
411 @DOCSTRING(lookfor) | |
412 | |
8817
03b7f618ab3d
include docstrings for new functions in the manual
John W. Eaton <jwe@octave.org>
parents:
8347
diff
changeset
|
413 To see what is new in the current release of Octave, use the @code{news} |
03b7f618ab3d
include docstrings for new functions in the manual
John W. Eaton <jwe@octave.org>
parents:
8347
diff
changeset
|
414 function. |
03b7f618ab3d
include docstrings for new functions in the manual
John W. Eaton <jwe@octave.org>
parents:
8347
diff
changeset
|
415 |
03b7f618ab3d
include docstrings for new functions in the manual
John W. Eaton <jwe@octave.org>
parents:
8347
diff
changeset
|
416 @DOCSTRING(news) |
03b7f618ab3d
include docstrings for new functions in the manual
John W. Eaton <jwe@octave.org>
parents:
8347
diff
changeset
|
417 |
03b7f618ab3d
include docstrings for new functions in the manual
John W. Eaton <jwe@octave.org>
parents:
8347
diff
changeset
|
418 @DOCSTRING(info) |
03b7f618ab3d
include docstrings for new functions in the manual
John W. Eaton <jwe@octave.org>
parents:
8347
diff
changeset
|
419 |
03b7f618ab3d
include docstrings for new functions in the manual
John W. Eaton <jwe@octave.org>
parents:
8347
diff
changeset
|
420 @DOCSTRING(warranty) |
03b7f618ab3d
include docstrings for new functions in the manual
John W. Eaton <jwe@octave.org>
parents:
8347
diff
changeset
|
421 |
9133
c0cef1436788
Update help text for sections 2.2 and 2.3 of basics.txi
Rik <rdrider0-list@yahoo.com>
parents:
9132
diff
changeset
|
422 The following functions can be used to change which programs are used |
6620 | 423 for displaying the documentation, and where the documentation can be |
424 found. | |
3294 | 425 |
6477 | 426 @DOCSTRING(info_file) |
3294 | 427 |
6477 | 428 @DOCSTRING(info_program) |
3294 | 429 |
6477 | 430 @DOCSTRING(makeinfo_program) |
3686 | 431 |
14618
36f451642f79
doc: Add texi_macros_file to manual.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
432 @DOCSTRING(texi_macros_file) |
36f451642f79
doc: Add texi_macros_file to manual.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
433 |
9133
c0cef1436788
Update help text for sections 2.2 and 2.3 of basics.txi
Rik <rdrider0-list@yahoo.com>
parents:
9132
diff
changeset
|
434 @DOCSTRING(doc_cache_file) |
c0cef1436788
Update help text for sections 2.2 and 2.3 of basics.txi
Rik <rdrider0-list@yahoo.com>
parents:
9132
diff
changeset
|
435 |
16807
2fd22fbaffa3
doc: Add built_in_docstrings_file() to documentation.
Rik <rik@octave.org>
parents:
16774
diff
changeset
|
436 @DOCSTRING(built_in_docstrings_file) |
2fd22fbaffa3
doc: Add built_in_docstrings_file() to documentation.
Rik <rik@octave.org>
parents:
16774
diff
changeset
|
437 |
3332 | 438 @DOCSTRING(suppress_verbose_help_message) |
3294 | 439 |
12519
91ccd08fe80c
Add gen_doc_cache, get_help_text, get_help_text_from_file, get_first_help_sentence to documentation.
Rik <octave@nomad.inbox5.com>
parents:
12175
diff
changeset
|
440 The following functions are principally used internally by Octave for |
91ccd08fe80c
Add gen_doc_cache, get_help_text, get_help_text_from_file, get_first_help_sentence to documentation.
Rik <octave@nomad.inbox5.com>
parents:
12175
diff
changeset
|
441 generating the documentation. They are documented here for completeness |
91ccd08fe80c
Add gen_doc_cache, get_help_text, get_help_text_from_file, get_first_help_sentence to documentation.
Rik <octave@nomad.inbox5.com>
parents:
12175
diff
changeset
|
442 and because they may occasionally be useful for users. |
91ccd08fe80c
Add gen_doc_cache, get_help_text, get_help_text_from_file, get_first_help_sentence to documentation.
Rik <octave@nomad.inbox5.com>
parents:
12175
diff
changeset
|
443 |
16872
5372068bb148
Rename gen_doc_cache() to doc_cache_create().
Rik <rik@octave.org>
parents:
16816
diff
changeset
|
444 @DOCSTRING(doc_cache_create) |
12519
91ccd08fe80c
Add gen_doc_cache, get_help_text, get_help_text_from_file, get_first_help_sentence to documentation.
Rik <octave@nomad.inbox5.com>
parents:
12175
diff
changeset
|
445 |
91ccd08fe80c
Add gen_doc_cache, get_help_text, get_help_text_from_file, get_first_help_sentence to documentation.
Rik <octave@nomad.inbox5.com>
parents:
12175
diff
changeset
|
446 @DOCSTRING(get_help_text) |
91ccd08fe80c
Add gen_doc_cache, get_help_text, get_help_text_from_file, get_first_help_sentence to documentation.
Rik <octave@nomad.inbox5.com>
parents:
12175
diff
changeset
|
447 |
91ccd08fe80c
Add gen_doc_cache, get_help_text, get_help_text_from_file, get_first_help_sentence to documentation.
Rik <octave@nomad.inbox5.com>
parents:
12175
diff
changeset
|
448 @DOCSTRING(get_help_text_from_file) |
91ccd08fe80c
Add gen_doc_cache, get_help_text, get_help_text_from_file, get_first_help_sentence to documentation.
Rik <octave@nomad.inbox5.com>
parents:
12175
diff
changeset
|
449 |
91ccd08fe80c
Add gen_doc_cache, get_help_text, get_help_text_from_file, get_first_help_sentence to documentation.
Rik <octave@nomad.inbox5.com>
parents:
12175
diff
changeset
|
450 @DOCSTRING(get_first_help_sentence) |
91ccd08fe80c
Add gen_doc_cache, get_help_text, get_help_text_from_file, get_first_help_sentence to documentation.
Rik <octave@nomad.inbox5.com>
parents:
12175
diff
changeset
|
451 |
4167 | 452 @node Command Line Editing |
3294 | 453 @section Command Line Editing |
454 @cindex command-line editing | |
455 @cindex editing the command line | |
456 | |
9134
a3739e27b017
Update section 2.4 of basics.txi
Rik <rdrider0-list@yahoo.com>
parents:
9133
diff
changeset
|
457 Octave uses the GNU Readline library to provide an extensive set of |
3294 | 458 command-line editing and history features. Only the most common |
9134
a3739e27b017
Update section 2.4 of basics.txi
Rik <rdrider0-list@yahoo.com>
parents:
9133
diff
changeset
|
459 features are described in this manual. In addition, all of the editing |
a3739e27b017
Update section 2.4 of basics.txi
Rik <rdrider0-list@yahoo.com>
parents:
9133
diff
changeset
|
460 functions can be bound to different key strokes at the user's discretion. |
a3739e27b017
Update section 2.4 of basics.txi
Rik <rdrider0-list@yahoo.com>
parents:
9133
diff
changeset
|
461 This manual assumes no changes from the default Emacs bindings. See the GNU |
a3739e27b017
Update section 2.4 of basics.txi
Rik <rdrider0-list@yahoo.com>
parents:
9133
diff
changeset
|
462 Readline Library manual for more information on customizing Readline and |
a3739e27b017
Update section 2.4 of basics.txi
Rik <rdrider0-list@yahoo.com>
parents:
9133
diff
changeset
|
463 for a complete feature list. |
3294 | 464 |
465 To insert printing characters (letters, digits, symbols, etc.), simply | |
466 type the character. Octave will insert the character at the cursor and | |
467 advance the cursor forward. | |
468 | |
469 Many of the command-line editing functions operate using control | |
470 characters. For example, the character @kbd{Control-a} moves the cursor | |
471 to the beginning of the line. To type @kbd{C-a}, hold down @key{CTRL} | |
472 and then press @key{a}. In the following sections, control characters | |
473 such as @kbd{Control-a} are written as @kbd{C-a}. | |
474 | |
9134
a3739e27b017
Update section 2.4 of basics.txi
Rik <rdrider0-list@yahoo.com>
parents:
9133
diff
changeset
|
475 Another set of command-line editing functions use Meta characters. To |
a3739e27b017
Update section 2.4 of basics.txi
Rik <rdrider0-list@yahoo.com>
parents:
9133
diff
changeset
|
476 type @kbd{M-u}, hold down the @key{META} key and press @key{u}. Depending |
a3739e27b017
Update section 2.4 of basics.txi
Rik <rdrider0-list@yahoo.com>
parents:
9133
diff
changeset
|
477 on the keyboard, the @key{META} key may be labeled @key{ALT} or |
a3739e27b017
Update section 2.4 of basics.txi
Rik <rdrider0-list@yahoo.com>
parents:
9133
diff
changeset
|
478 even @key{WINDOWS}. If your terminal does not have a @key{META} key, you |
7001 | 479 can still type Meta characters using two-character sequences starting |
9134
a3739e27b017
Update section 2.4 of basics.txi
Rik <rdrider0-list@yahoo.com>
parents:
9133
diff
changeset
|
480 with @kbd{ESC}. Thus, to enter @kbd{M-u}, you would type |
9035
57649dcecb55
Documentation cleanup of basics.texi
Rik <rdrider0-list@yahoo.com>
parents:
9032
diff
changeset
|
481 @key{ESC} @key{u}. The @kbd{ESC} character sequences are also allowed on |
3294 | 482 terminals with real Meta keys. In the following sections, Meta |
483 characters such as @kbd{Meta-u} are written as @kbd{M-u}. | |
484 | |
3428 | 485 |
3294 | 486 @menu |
17152
f2a8592b8fbd
doc: Shorten some long subsection names in Manual.
Rik <rik@octave.org>
parents:
17097
diff
changeset
|
487 * Cursor Motion:: |
f2a8592b8fbd
doc: Shorten some long subsection names in Manual.
Rik <rik@octave.org>
parents:
17097
diff
changeset
|
488 * Killing and Yanking:: |
f2a8592b8fbd
doc: Shorten some long subsection names in Manual.
Rik <rik@octave.org>
parents:
17097
diff
changeset
|
489 * Commands For Text:: |
f2a8592b8fbd
doc: Shorten some long subsection names in Manual.
Rik <rik@octave.org>
parents:
17097
diff
changeset
|
490 * Commands For Completion:: |
f2a8592b8fbd
doc: Shorten some long subsection names in Manual.
Rik <rik@octave.org>
parents:
17097
diff
changeset
|
491 * Commands For History:: |
f2a8592b8fbd
doc: Shorten some long subsection names in Manual.
Rik <rik@octave.org>
parents:
17097
diff
changeset
|
492 * Customizing readline:: |
f2a8592b8fbd
doc: Shorten some long subsection names in Manual.
Rik <rik@octave.org>
parents:
17097
diff
changeset
|
493 * Customizing the Prompt:: |
f2a8592b8fbd
doc: Shorten some long subsection names in Manual.
Rik <rik@octave.org>
parents:
17097
diff
changeset
|
494 * Diary and Echo Commands:: |
3294 | 495 @end menu |
496 | |
4167 | 497 @node Cursor Motion |
3294 | 498 @subsection Cursor Motion |
499 | |
500 The following commands allow you to position the cursor. | |
501 | |
502 @table @kbd | |
503 @item C-b | |
504 Move back one character. | |
505 | |
506 @item C-f | |
507 Move forward one character. | |
508 | |
11487
0f14c093476e
Add <BACKSPACE> documentation to cursor movement section.
Rik <octave@nomad.inbox5.com>
parents:
11486
diff
changeset
|
509 @item @key{BACKSPACE} |
0f14c093476e
Add <BACKSPACE> documentation to cursor movement section.
Rik <octave@nomad.inbox5.com>
parents:
11486
diff
changeset
|
510 Delete the character to the left of the cursor. |
0f14c093476e
Add <BACKSPACE> documentation to cursor movement section.
Rik <octave@nomad.inbox5.com>
parents:
11486
diff
changeset
|
511 |
3294 | 512 @item @key{DEL} |
11487
0f14c093476e
Add <BACKSPACE> documentation to cursor movement section.
Rik <octave@nomad.inbox5.com>
parents:
11486
diff
changeset
|
513 Delete the character underneath the cursor. |
3294 | 514 |
515 @item C-d | |
516 Delete the character underneath the cursor. | |
517 | |
518 @item M-f | |
519 Move forward a word. | |
520 | |
521 @item M-b | |
522 Move backward a word. | |
523 | |
524 @item C-a | |
525 Move to the start of the line. | |
526 | |
527 @item C-e | |
528 Move to the end of the line. | |
529 | |
530 @item C-l | |
531 Clear the screen, reprinting the current line at the top. | |
532 | |
17170
d6499c14021c
doc: Periodic grammarcheck of documentation.
Rik <rik@octave.org>
parents:
17152
diff
changeset
|
533 @item C-_ |
3294 | 534 @itemx C-/ |
9134
a3739e27b017
Update section 2.4 of basics.txi
Rik <rdrider0-list@yahoo.com>
parents:
9133
diff
changeset
|
535 Undo the last action. You can undo all the way back to an empty line. |
3294 | 536 |
537 @item M-r | |
538 Undo all changes made to this line. This is like typing the `undo' | |
539 command enough times to get back to the beginning. | |
540 @end table | |
541 | |
542 The above table describes the most basic possible keystrokes that you need | |
543 in order to do editing of the input line. On most terminals, you can | |
9134
a3739e27b017
Update section 2.4 of basics.txi
Rik <rdrider0-list@yahoo.com>
parents:
9133
diff
changeset
|
544 also use the left and right arrow keys in place of @kbd{C-f} and @kbd{C-b} |
a3739e27b017
Update section 2.4 of basics.txi
Rik <rdrider0-list@yahoo.com>
parents:
9133
diff
changeset
|
545 to move forward and backward. |
3294 | 546 |
547 Notice how @kbd{C-f} moves forward a character, while @kbd{M-f} moves | |
548 forward a word. It is a loose convention that control keystrokes | |
549 operate on characters while meta keystrokes operate on words. | |
550 | |
551 @cindex clearing the screen | |
552 | |
6620 | 553 The function @code{clc} will allow you to clear the screen from within |
554 Octave programs. | |
555 | |
3332 | 556 @DOCSTRING(clc) |
3294 | 557 |
4167 | 558 @node Killing and Yanking |
3294 | 559 @subsection Killing and Yanking |
560 | |
561 @dfn{Killing} text means to delete the text from the line, but to save | |
562 it away for later use, usually by @dfn{yanking} it back into the line. | |
563 If the description for a command says that it `kills' text, then you can | |
564 be sure that you can get the text back in a different (or the same) | |
565 place later. | |
566 | |
567 Here is the list of commands for killing text. | |
568 | |
569 @table @kbd | |
570 @item C-k | |
571 Kill the text from the current cursor position to the end of the line. | |
572 | |
573 @item M-d | |
574 Kill from the cursor to the end of the current word, or if between | |
575 words, to the end of the next word. | |
576 | |
577 @item M-@key{DEL} | |
578 Kill from the cursor to the start of the previous word, or if between | |
579 words, to the start of the previous word. | |
580 | |
581 @item C-w | |
582 Kill from the cursor to the previous whitespace. This is different than | |
583 @kbd{M-@key{DEL}} because the word boundaries differ. | |
584 @end table | |
585 | |
586 And, here is how to @dfn{yank} the text back into the line. Yanking | |
587 means to copy the most-recently-killed text from the kill buffer. | |
588 | |
589 @table @kbd | |
590 @item C-y | |
591 Yank the most recently killed text back into the buffer at the cursor. | |
592 | |
593 @item M-y | |
594 Rotate the kill-ring, and yank the new top. You can only do this if | |
595 the prior command is @kbd{C-y} or @kbd{M-y}. | |
596 @end table | |
597 | |
598 When you use a kill command, the text is saved in a @dfn{kill-ring}. | |
599 Any number of consecutive kills save all of the killed text together, so | |
600 that when you yank it back, you get it in one clean sweep. The kill | |
601 ring is not line specific; the text that you killed on a previously | |
602 typed line is available to be yanked back later, when you are typing | |
603 another line. | |
604 | |
4167 | 605 @node Commands For Text |
3294 | 606 @subsection Commands For Changing Text |
607 | |
608 The following commands can be used for entering characters that would | |
9035
57649dcecb55
Documentation cleanup of basics.texi
Rik <rdrider0-list@yahoo.com>
parents:
9032
diff
changeset
|
609 otherwise have a special meaning (e.g., @key{TAB}, @kbd{C-q}, etc.), or |
3294 | 610 for quickly correcting typing mistakes. |
611 | |
612 @table @kbd | |
17170
d6499c14021c
doc: Periodic grammarcheck of documentation.
Rik <rik@octave.org>
parents:
17152
diff
changeset
|
613 @item C-q |
3294 | 614 @itemx C-v |
615 Add the next character that you type to the line verbatim. This is | |
616 how to insert things like @kbd{C-q} for example. | |
617 | |
618 @item M-@key{TAB} | |
619 Insert a tab character. | |
620 | |
621 @item C-t | |
622 Drag the character before the cursor forward over the character at the | |
623 cursor, also moving the cursor forward. If the cursor is at the end of | |
624 the line, then transpose the two characters before it. | |
625 | |
626 @item M-t | |
627 Drag the word behind the cursor past the word in front of the cursor | |
628 moving the cursor over that word as well. | |
629 | |
630 @item M-u | |
631 Uppercase the characters following the cursor to the end of the current | |
632 (or following) word, moving the cursor to the end of the word. | |
633 | |
634 @item M-l | |
6620 | 635 Lowercase the characters following the cursor to the end of the current |
3294 | 636 (or following) word, moving the cursor to the end of the word. |
637 | |
638 @item M-c | |
639 Uppercase the character following the cursor (or the beginning of the | |
640 next word if the cursor is between words), moving the cursor to the end | |
641 of the word. | |
642 @end table | |
643 | |
4167 | 644 @node Commands For Completion |
3294 | 645 @subsection Letting Readline Type For You |
646 @cindex command completion | |
647 | |
648 The following commands allow Octave to complete command and variable | |
649 names for you. | |
650 | |
651 @table @kbd | |
652 @item @key{TAB} | |
653 Attempt to do completion on the text before the cursor. Octave can | |
654 complete the names of commands and variables. | |
655 | |
656 @item M-? | |
657 List the possible completions of the text before the cursor. | |
658 @end table | |
659 | |
3332 | 660 @DOCSTRING(completion_append_char) |
3294 | 661 |
3332 | 662 @DOCSTRING(completion_matches) |
3294 | 663 |
4167 | 664 @node Commands For History |
3294 | 665 @subsection Commands For Manipulating The History |
666 @cindex command history | |
667 @cindex input history | |
668 @cindex history of commands | |
669 | |
670 Octave normally keeps track of the commands you type so that you can | |
671 recall previous commands to edit or execute them again. When you exit | |
672 Octave, the most recent commands you have typed, up to the number | |
673 specified by the variable @code{history_size}, are saved in a file. | |
674 When Octave starts, it loads an initial list of commands from the file | |
675 named by the variable @code{history_file}. | |
676 | |
677 Here are the commands for simple browsing and searching the history | |
678 list. | |
679 | |
680 @table @kbd | |
17170
d6499c14021c
doc: Periodic grammarcheck of documentation.
Rik <rik@octave.org>
parents:
17152
diff
changeset
|
681 @item @key{LFD} |
3294 | 682 @itemx @key{RET} |
9035
57649dcecb55
Documentation cleanup of basics.texi
Rik <rdrider0-list@yahoo.com>
parents:
9032
diff
changeset
|
683 Accept the current line regardless of where the cursor is. If the line is |
57649dcecb55
Documentation cleanup of basics.texi
Rik <rdrider0-list@yahoo.com>
parents:
9032
diff
changeset
|
684 non-empty, add it to the history list. If the line was a history |
3294 | 685 line, then restore the history line to its original state. |
686 | |
687 @item C-p | |
688 Move `up' through the history list. | |
689 | |
690 @item C-n | |
691 Move `down' through the history list. | |
692 | |
693 @item M-< | |
694 Move to the first line in the history. | |
695 | |
696 @item M-> | |
697 Move to the end of the input history, i.e., the line you are entering! | |
698 | |
699 @item C-r | |
700 Search backward starting at the current line and moving `up' through | |
701 the history as necessary. This is an incremental search. | |
702 | |
703 @item C-s | |
704 Search forward starting at the current line and moving `down' through | |
705 the history as necessary. | |
706 @end table | |
707 | |
9134
a3739e27b017
Update section 2.4 of basics.txi
Rik <rdrider0-list@yahoo.com>
parents:
9133
diff
changeset
|
708 On most terminals, you can also use the up and down arrow keys in place |
a3739e27b017
Update section 2.4 of basics.txi
Rik <rdrider0-list@yahoo.com>
parents:
9133
diff
changeset
|
709 of @kbd{C-p} and @kbd{C-n} to move through the history list. |
3294 | 710 |
711 In addition to the keyboard commands for moving through the history | |
712 list, Octave provides three functions for viewing, editing, and | |
713 re-running chunks of commands from the history list. | |
714 | |
3332 | 715 @DOCSTRING(history) |
3294 | 716 |
3332 | 717 @DOCSTRING(edit_history) |
3294 | 718 |
3332 | 719 @DOCSTRING(run_history) |
3294 | 720 |
9134
a3739e27b017
Update section 2.4 of basics.txi
Rik <rdrider0-list@yahoo.com>
parents:
9133
diff
changeset
|
721 @noindent |
a3739e27b017
Update section 2.4 of basics.txi
Rik <rdrider0-list@yahoo.com>
parents:
9133
diff
changeset
|
722 Octave also allows you customize the details of when, where, and how history |
6620 | 723 is saved. |
3294 | 724 |
16876
9e0618443c2b
Rename saving_history() to history_save().
Rik <rik@octave.org>
parents:
16875
diff
changeset
|
725 @DOCSTRING(history_save) |
9134
a3739e27b017
Update section 2.4 of basics.txi
Rik <rdrider0-list@yahoo.com>
parents:
9133
diff
changeset
|
726 |
11486
a1deab9a6e71
bash-like history control
Pascal Dupuis <Pascal.Dupuis@worldonline.be> and John W. Eaton <jwe@octave.org>
parents:
10846
diff
changeset
|
727 @DOCSTRING(history_control) |
a1deab9a6e71
bash-like history control
Pascal Dupuis <Pascal.Dupuis@worldonline.be> and John W. Eaton <jwe@octave.org>
parents:
10846
diff
changeset
|
728 |
3332 | 729 @DOCSTRING(history_file) |
3294 | 730 |
3332 | 731 @DOCSTRING(history_size) |
3294 | 732 |
6550 | 733 @DOCSTRING(history_timestamp_format_string) |
734 | |
6620 | 735 @DOCSTRING(EDITOR) |
736 | |
4167 | 737 @node Customizing readline |
3428 | 738 @subsection Customizing @code{readline} |
12175
2090995ca588
Correct en-dash,em-dash instances in docstrings.
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
739 @cindex @code{~/.inputrc} |
9134
a3739e27b017
Update section 2.4 of basics.txi
Rik <rdrider0-list@yahoo.com>
parents:
9133
diff
changeset
|
740 @cindex customizing @code{readline} |
a3739e27b017
Update section 2.4 of basics.txi
Rik <rdrider0-list@yahoo.com>
parents:
9133
diff
changeset
|
741 @cindex @code{readline} customization |
3428 | 742 |
9134
a3739e27b017
Update section 2.4 of basics.txi
Rik <rdrider0-list@yahoo.com>
parents:
9133
diff
changeset
|
743 Octave uses the GNU Readline library for command-line editing and |
a3739e27b017
Update section 2.4 of basics.txi
Rik <rdrider0-list@yahoo.com>
parents:
9133
diff
changeset
|
744 history features. Readline is very flexible and can be modified through |
a3739e27b017
Update section 2.4 of basics.txi
Rik <rdrider0-list@yahoo.com>
parents:
9133
diff
changeset
|
745 a configuration file of commands (See the GNU Readline library for the |
a3739e27b017
Update section 2.4 of basics.txi
Rik <rdrider0-list@yahoo.com>
parents:
9133
diff
changeset
|
746 exact command syntax). The default configuration file is normally |
a3739e27b017
Update section 2.4 of basics.txi
Rik <rdrider0-list@yahoo.com>
parents:
9133
diff
changeset
|
747 @file{~/.inputrc}. |
6620 | 748 |
9134
a3739e27b017
Update section 2.4 of basics.txi
Rik <rdrider0-list@yahoo.com>
parents:
9133
diff
changeset
|
749 Octave provides two commands for initializing Readline and thereby changing |
a3739e27b017
Update section 2.4 of basics.txi
Rik <rdrider0-list@yahoo.com>
parents:
9133
diff
changeset
|
750 the command line behavior. |
3428 | 751 |
16879
cc3743a91652
Rename read_readline_init_file to readline_read_init_file.
Rik <rik@octave.org>
parents:
16877
diff
changeset
|
752 @DOCSTRING(readline_read_init_file) |
3428 | 753 |
16880
1aebb613a5ac
Rename re_read_readline_init_file to readline_re_read_init_file.
Rik <rik@octave.org>
parents:
16879
diff
changeset
|
754 @DOCSTRING(readline_re_read_init_file) |
8817
03b7f618ab3d
include docstrings for new functions in the manual
John W. Eaton <jwe@octave.org>
parents:
8347
diff
changeset
|
755 |
4167 | 756 @node Customizing the Prompt |
3294 | 757 @subsection Customizing the Prompt |
758 @cindex prompt customization | |
759 @cindex customizing the prompt | |
760 | |
761 The following variables are available for customizing the appearance of | |
762 the command-line prompts. Octave allows the prompt to be customized by | |
763 inserting a number of backslash-escaped special characters that are | |
764 decoded as follows: | |
765 | |
766 @table @samp | |
767 @item \t | |
768 The time. | |
769 | |
770 @item \d | |
771 The date. | |
772 | |
773 @item \n | |
774 Begins a new line by printing the equivalent of a carriage return | |
775 followed by a line feed. | |
776 | |
777 @item \s | |
778 The name of the program (usually just @samp{octave}). | |
779 | |
780 @item \w | |
781 The current working directory. | |
782 | |
783 @item \W | |
784 The basename of the current working directory. | |
785 | |
786 @item \u | |
787 The username of the current user. | |
788 | |
789 @item \h | |
790 The hostname, up to the first `.'. | |
791 | |
792 @item \H | |
793 The hostname. | |
794 | |
795 @item \# | |
796 The command number of this command, counting from when Octave starts. | |
797 | |
798 @item \! | |
799 The history number of this command. This differs from @samp{\#} by the | |
800 number of commands in the history list when Octave starts. | |
801 | |
802 @item \$ | |
803 If the effective UID is 0, a @samp{#}, otherwise a @samp{$}. | |
804 | |
805 @item \nnn | |
806 The character whose character code in octal is @var{nnn}. | |
807 | |
808 @item \\ | |
809 A backslash. | |
810 @end table | |
811 | |
3332 | 812 @DOCSTRING(PS1) |
3294 | 813 |
3332 | 814 @DOCSTRING(PS2) |
3294 | 815 |
3332 | 816 @DOCSTRING(PS4) |
3294 | 817 |
4167 | 818 @node Diary and Echo Commands |
3294 | 819 @subsection Diary and Echo Commands |
820 @cindex diary of commands and output | |
6939 | 821 @cindex command and output logs |
3294 | 822 @cindex logging commands and output |
823 @cindex echoing executing commands | |
824 @cindex command echoing | |
825 | |
826 Octave's diary feature allows you to keep a log of all or part of an | |
827 interactive session by recording the input you type and the output that | |
828 Octave produces in a separate file. | |
829 | |
3332 | 830 @DOCSTRING(diary) |
3294 | 831 |
832 Sometimes it is useful to see the commands in a function or script as | |
833 they are being evaluated. This can be especially helpful for debugging | |
834 some kinds of problems. | |
835 | |
3332 | 836 @DOCSTRING(echo) |
3294 | 837 |
3332 | 838 @DOCSTRING(echo_executing_commands) |
3294 | 839 |
4167 | 840 @node Errors |
3294 | 841 @section How Octave Reports Errors |
842 @cindex error messages | |
843 @cindex messages, error | |
844 | |
845 Octave reports two kinds of errors for invalid programs. | |
846 | |
847 A @dfn{parse error} occurs if Octave cannot understand something you | |
848 have typed. For example, if you misspell a keyword, | |
849 | |
850 @example | |
9135
b04f95fabbf9
Update sections 2.5, 2.6, 2.7 of basics.txi
Rik <rdrider0-list@yahoo.com>
parents:
9134
diff
changeset
|
851 octave:13> function y = f (x) y = x***2; endfunction |
3294 | 852 @end example |
853 | |
854 @noindent | |
855 Octave will respond immediately with a message like this: | |
856 | |
857 @example | |
9132
eb1747dbd360
Update help strings for command line options
Rik <rdrider0-list@yahoo.com>
parents:
9051
diff
changeset
|
858 @group |
3294 | 859 parse error: |
860 | |
8015
30629059b72d
Update the manual to reflect the changes in error output
sh@sh-laptop
parents:
7031
diff
changeset
|
861 syntax error |
30629059b72d
Update the manual to reflect the changes in error output
sh@sh-laptop
parents:
7031
diff
changeset
|
862 |
9135
b04f95fabbf9
Update sections 2.5, 2.6, 2.7 of basics.txi
Rik <rdrider0-list@yahoo.com>
parents:
9134
diff
changeset
|
863 >>> function y = f (x) y = x***2; endfunction |
b04f95fabbf9
Update sections 2.5, 2.6, 2.7 of basics.txi
Rik <rdrider0-list@yahoo.com>
parents:
9134
diff
changeset
|
864 ^ |
9132
eb1747dbd360
Update help strings for command line options
Rik <rdrider0-list@yahoo.com>
parents:
9051
diff
changeset
|
865 @end group |
3294 | 866 @end example |
867 | |
868 @noindent | |
869 For most parse errors, Octave uses a caret (@samp{^}) to mark the point | |
870 on the line where it was unable to make sense of your input. In this | |
9135
b04f95fabbf9
Update sections 2.5, 2.6, 2.7 of basics.txi
Rik <rdrider0-list@yahoo.com>
parents:
9134
diff
changeset
|
871 case, Octave generated an error message because the keyword for |
b04f95fabbf9
Update sections 2.5, 2.6, 2.7 of basics.txi
Rik <rdrider0-list@yahoo.com>
parents:
9134
diff
changeset
|
872 exponentiation (@code{**}) was misspelled. It marked the error at the |
b04f95fabbf9
Update sections 2.5, 2.6, 2.7 of basics.txi
Rik <rdrider0-list@yahoo.com>
parents:
9134
diff
changeset
|
873 third @samp{*} because the code leading up to this was correct but the final |
b04f95fabbf9
Update sections 2.5, 2.6, 2.7 of basics.txi
Rik <rdrider0-list@yahoo.com>
parents:
9134
diff
changeset
|
874 @samp{*} was not understood. |
3294 | 875 |
876 Another class of error message occurs at evaluation time. These | |
877 errors are called @dfn{run-time errors}, or sometimes | |
9035
57649dcecb55
Documentation cleanup of basics.texi
Rik <rdrider0-list@yahoo.com>
parents:
9032
diff
changeset
|
878 @dfn{evaluation errors}, because they occur when your program is being |
3294 | 879 @dfn{run}, or @dfn{evaluated}. For example, if after correcting the |
880 mistake in the previous function definition, you type | |
881 | |
882 @example | |
883 octave:13> f () | |
884 @end example | |
885 | |
886 @noindent | |
887 Octave will respond with | |
888 | |
9153
5247e89688e1
Eliminate most overfull errors when running texi2pdf for generating pdf documentation
Rik <rdrider0-list@yahoo.com>
parents:
9135
diff
changeset
|
889 @example |
3294 | 890 @group |
891 error: `x' undefined near line 1 column 24 | |
8015
30629059b72d
Update the manual to reflect the changes in error output
sh@sh-laptop
parents:
7031
diff
changeset
|
892 error: called from: |
30629059b72d
Update the manual to reflect the changes in error output
sh@sh-laptop
parents:
7031
diff
changeset
|
893 error: f at line 1, column 22 |
3294 | 894 @end group |
9153
5247e89688e1
Eliminate most overfull errors when running texi2pdf for generating pdf documentation
Rik <rdrider0-list@yahoo.com>
parents:
9135
diff
changeset
|
895 @end example |
3294 | 896 |
6620 | 897 @noindent |
9135
b04f95fabbf9
Update sections 2.5, 2.6, 2.7 of basics.txi
Rik <rdrider0-list@yahoo.com>
parents:
9134
diff
changeset
|
898 This error message has several parts, and gives quite a bit of |
3294 | 899 information to help you locate the source of the error. The messages |
900 are generated from the point of the innermost error, and provide a | |
901 traceback of enclosing expressions and function calls. | |
902 | |
903 In the example above, the first line indicates that a variable named | |
904 @samp{x} was found to be undefined near line 1 and column 24 of some | |
905 function or expression. For errors occurring within functions, lines | |
906 are counted from the beginning of the file containing the function | |
9135
b04f95fabbf9
Update sections 2.5, 2.6, 2.7 of basics.txi
Rik <rdrider0-list@yahoo.com>
parents:
9134
diff
changeset
|
907 definition. For errors occurring outside of an enclosing function, |
b04f95fabbf9
Update sections 2.5, 2.6, 2.7 of basics.txi
Rik <rdrider0-list@yahoo.com>
parents:
9134
diff
changeset
|
908 the line number indicates the input line number, which is usually displayed |
b04f95fabbf9
Update sections 2.5, 2.6, 2.7 of basics.txi
Rik <rdrider0-list@yahoo.com>
parents:
9134
diff
changeset
|
909 in the primary prompt string. |
3294 | 910 |
9135
b04f95fabbf9
Update sections 2.5, 2.6, 2.7 of basics.txi
Rik <rdrider0-list@yahoo.com>
parents:
9134
diff
changeset
|
911 The second and third lines of the error message indicate that the error |
b04f95fabbf9
Update sections 2.5, 2.6, 2.7 of basics.txi
Rik <rdrider0-list@yahoo.com>
parents:
9134
diff
changeset
|
912 occurred within the function @code{f}. If the function @code{f} had been |
b04f95fabbf9
Update sections 2.5, 2.6, 2.7 of basics.txi
Rik <rdrider0-list@yahoo.com>
parents:
9134
diff
changeset
|
913 called from within another function, for example, @code{g}, the list of |
b04f95fabbf9
Update sections 2.5, 2.6, 2.7 of basics.txi
Rik <rdrider0-list@yahoo.com>
parents:
9134
diff
changeset
|
914 errors would have ended with one more line: |
3294 | 915 |
916 @example | |
8015
30629059b72d
Update the manual to reflect the changes in error output
sh@sh-laptop
parents:
7031
diff
changeset
|
917 error: g at line 1, column 17 |
3294 | 918 @end example |
919 | |
9035
57649dcecb55
Documentation cleanup of basics.texi
Rik <rdrider0-list@yahoo.com>
parents:
9032
diff
changeset
|
920 These lists of function calls make it fairly easy to trace the |
3294 | 921 path your program took before the error occurred, and to correct the |
922 error before trying again. | |
923 | |
4167 | 924 @node Executable Octave Programs |
3294 | 925 @section Executable Octave Programs |
926 @cindex executable scripts | |
927 @cindex scripts | |
9135
b04f95fabbf9
Update sections 2.5, 2.6, 2.7 of basics.txi
Rik <rdrider0-list@yahoo.com>
parents:
9134
diff
changeset
|
928 @cindex batch processing |
3294 | 929 @cindex self contained programs |
930 @cindex program, self contained | |
931 @cindex @samp{#!} | |
932 | |
933 Once you have learned Octave, you may want to write self-contained | |
934 Octave scripts, using the @samp{#!} script mechanism. You can do this | |
935 on GNU systems and on many Unix systems @footnote{The @samp{#!} | |
936 mechanism works on Unix systems derived from Berkeley Unix, System V | |
6481 | 937 Release 4, and some System V Release 3 systems.}. |
938 | |
939 Self-contained Octave scripts are useful when you want to write a | |
940 program which users can invoke without knowing that the program is | |
9135
b04f95fabbf9
Update sections 2.5, 2.6, 2.7 of basics.txi
Rik <rdrider0-list@yahoo.com>
parents:
9134
diff
changeset
|
941 written in the Octave language. Octave scripts are also used for batch |
b04f95fabbf9
Update sections 2.5, 2.6, 2.7 of basics.txi
Rik <rdrider0-list@yahoo.com>
parents:
9134
diff
changeset
|
942 processing of data files. Once an algorithm has been developed and tested |
b04f95fabbf9
Update sections 2.5, 2.6, 2.7 of basics.txi
Rik <rdrider0-list@yahoo.com>
parents:
9134
diff
changeset
|
943 in the interactive portion of Octave, it can be committed to an executable |
b04f95fabbf9
Update sections 2.5, 2.6, 2.7 of basics.txi
Rik <rdrider0-list@yahoo.com>
parents:
9134
diff
changeset
|
944 script and used again and again on new data files. |
3294 | 945 |
9135
b04f95fabbf9
Update sections 2.5, 2.6, 2.7 of basics.txi
Rik <rdrider0-list@yahoo.com>
parents:
9134
diff
changeset
|
946 As a trivial example of an executable Octave script, you might create a |
b04f95fabbf9
Update sections 2.5, 2.6, 2.7 of basics.txi
Rik <rdrider0-list@yahoo.com>
parents:
9134
diff
changeset
|
947 text file named @file{hello}, containing the following lines: |
3294 | 948 |
949 @example | |
950 @group | |
951 #! @var{octave-interpreter-name} -qf | |
952 # a sample Octave program | |
953 printf ("Hello, world!\n"); | |
954 @end group | |
955 @end example | |
956 | |
957 @noindent | |
958 (where @var{octave-interpreter-name} should be replaced with the full | |
9135
b04f95fabbf9
Update sections 2.5, 2.6, 2.7 of basics.txi
Rik <rdrider0-list@yahoo.com>
parents:
9134
diff
changeset
|
959 path and name of your Octave binary). Note that this will only work if |
b04f95fabbf9
Update sections 2.5, 2.6, 2.7 of basics.txi
Rik <rdrider0-list@yahoo.com>
parents:
9134
diff
changeset
|
960 @samp{#!} appears at the very beginning of the file. After making the |
b04f95fabbf9
Update sections 2.5, 2.6, 2.7 of basics.txi
Rik <rdrider0-list@yahoo.com>
parents:
9134
diff
changeset
|
961 file executable (with the @code{chmod} command on Unix systems), you can |
b04f95fabbf9
Update sections 2.5, 2.6, 2.7 of basics.txi
Rik <rdrider0-list@yahoo.com>
parents:
9134
diff
changeset
|
962 simply type: |
3294 | 963 |
964 @example | |
965 hello | |
966 @end example | |
967 | |
968 @noindent | |
969 at the shell, and the system will arrange to run Octave as if you had | |
970 typed: | |
971 | |
972 @example | |
973 octave hello | |
974 @end example | |
975 | |
9135
b04f95fabbf9
Update sections 2.5, 2.6, 2.7 of basics.txi
Rik <rdrider0-list@yahoo.com>
parents:
9134
diff
changeset
|
976 The line beginning with @samp{#!} lists the full path and filename of an |
3294 | 977 interpreter to be run, and an optional initial command line argument to |
978 pass to that interpreter. The operating system then runs the | |
979 interpreter with the given argument and the full argument list of the | |
980 executed program. The first argument in the list is the full file name | |
9135
b04f95fabbf9
Update sections 2.5, 2.6, 2.7 of basics.txi
Rik <rdrider0-list@yahoo.com>
parents:
9134
diff
changeset
|
981 of the Octave executable. The rest of the argument list will either be |
b04f95fabbf9
Update sections 2.5, 2.6, 2.7 of basics.txi
Rik <rdrider0-list@yahoo.com>
parents:
9134
diff
changeset
|
982 options to Octave, or data files, or both. The @samp{-qf} options are |
3294 | 983 usually specified in stand-alone Octave programs to prevent them from |
984 printing the normal startup message, and to keep them from behaving | |
985 differently depending on the contents of a particular user's | |
6620 | 986 @file{~/.octaverc} file. @xref{Invoking Octave from the Command Line}. |
6481 | 987 |
988 Note that some operating systems may place a limit on the number of | |
9135
b04f95fabbf9
Update sections 2.5, 2.6, 2.7 of basics.txi
Rik <rdrider0-list@yahoo.com>
parents:
9134
diff
changeset
|
989 characters that are recognized after @samp{#!}. Also, the arguments |
b04f95fabbf9
Update sections 2.5, 2.6, 2.7 of basics.txi
Rik <rdrider0-list@yahoo.com>
parents:
9134
diff
changeset
|
990 appearing in a @samp{#!} line are parsed differently by various |
b04f95fabbf9
Update sections 2.5, 2.6, 2.7 of basics.txi
Rik <rdrider0-list@yahoo.com>
parents:
9134
diff
changeset
|
991 shells/systems. The majority of them group all the arguments together in one |
b04f95fabbf9
Update sections 2.5, 2.6, 2.7 of basics.txi
Rik <rdrider0-list@yahoo.com>
parents:
9134
diff
changeset
|
992 string and pass it to the interpreter as a single argument. In this case, the |
6481 | 993 following script: |
994 | |
995 @example | |
996 @group | |
997 #! @var{octave-interpreter-name} -q -f # comment | |
998 @end group | |
999 @end example | |
1000 | |
1001 @noindent | |
9135
b04f95fabbf9
Update sections 2.5, 2.6, 2.7 of basics.txi
Rik <rdrider0-list@yahoo.com>
parents:
9134
diff
changeset
|
1002 is equivalent to typing at the command line: |
3294 | 1003 |
6481 | 1004 @example |
1005 @group | |
1006 octave "-q -f # comment" | |
1007 @end group | |
1008 @end example | |
3294 | 1009 |
6481 | 1010 @noindent |
9135
b04f95fabbf9
Update sections 2.5, 2.6, 2.7 of basics.txi
Rik <rdrider0-list@yahoo.com>
parents:
9134
diff
changeset
|
1011 which will produce an error message. Unfortunately, it is |
b04f95fabbf9
Update sections 2.5, 2.6, 2.7 of basics.txi
Rik <rdrider0-list@yahoo.com>
parents:
9134
diff
changeset
|
1012 not possible for Octave to determine whether it has been called from the |
b04f95fabbf9
Update sections 2.5, 2.6, 2.7 of basics.txi
Rik <rdrider0-list@yahoo.com>
parents:
9134
diff
changeset
|
1013 command line or from a @samp{#!} script, so some care is needed when using the |
6481 | 1014 @samp{#!} mechanism. |
1015 | |
1016 Note that when Octave is started from an executable script, the built-in | |
1017 function @code{argv} returns a cell array containing the command line | |
9135
b04f95fabbf9
Update sections 2.5, 2.6, 2.7 of basics.txi
Rik <rdrider0-list@yahoo.com>
parents:
9134
diff
changeset
|
1018 arguments passed to the executable Octave script, not the arguments |
6481 | 1019 passed to the Octave interpreter on the @samp{#!} line of the script. |
1020 For example, the following program will reproduce the command line that | |
9135
b04f95fabbf9
Update sections 2.5, 2.6, 2.7 of basics.txi
Rik <rdrider0-list@yahoo.com>
parents:
9134
diff
changeset
|
1021 was used to execute the script, not @samp{-qf}. |
3294 | 1022 |
1023 @example | |
1024 @group | |
1025 #! /bin/octave -qf | |
6479 | 1026 printf ("%s", program_name ()); |
6620 | 1027 arg_list = argv (); |
3294 | 1028 for i = 1:nargin |
6479 | 1029 printf (" %s", arg_list@{i@}); |
3294 | 1030 endfor |
1031 printf ("\n"); | |
1032 @end group | |
1033 @end example | |
1034 | |
4167 | 1035 @node Comments |
3294 | 1036 @section Comments in Octave Programs |
1037 @cindex comments | |
1038 @cindex use of comments | |
1039 @cindex documenting Octave programs | |
1040 | |
1041 A @dfn{comment} is some text that is included in a program for the sake | |
9135
b04f95fabbf9
Update sections 2.5, 2.6, 2.7 of basics.txi
Rik <rdrider0-list@yahoo.com>
parents:
9134
diff
changeset
|
1042 of human readers, and which is NOT an executable part of the program. |
9035
57649dcecb55
Documentation cleanup of basics.texi
Rik <rdrider0-list@yahoo.com>
parents:
9032
diff
changeset
|
1043 Comments can explain what the program does, and how it works. Nearly all |
3294 | 1044 programming languages have provisions for comments, because programs are |
1045 typically hard to understand without them. | |
1046 | |
9035
57649dcecb55
Documentation cleanup of basics.texi
Rik <rdrider0-list@yahoo.com>
parents:
9032
diff
changeset
|
1047 @menu |
57649dcecb55
Documentation cleanup of basics.texi
Rik <rdrider0-list@yahoo.com>
parents:
9032
diff
changeset
|
1048 * Single Line Comments:: |
57649dcecb55
Documentation cleanup of basics.texi
Rik <rdrider0-list@yahoo.com>
parents:
9032
diff
changeset
|
1049 * Block Comments:: |
17152
f2a8592b8fbd
doc: Shorten some long subsection names in Manual.
Rik <rik@octave.org>
parents:
17097
diff
changeset
|
1050 * Comments and the Help System:: |
9035
57649dcecb55
Documentation cleanup of basics.texi
Rik <rdrider0-list@yahoo.com>
parents:
9032
diff
changeset
|
1051 @end menu |
57649dcecb55
Documentation cleanup of basics.texi
Rik <rdrider0-list@yahoo.com>
parents:
9032
diff
changeset
|
1052 |
57649dcecb55
Documentation cleanup of basics.texi
Rik <rdrider0-list@yahoo.com>
parents:
9032
diff
changeset
|
1053 @node Single Line Comments |
57649dcecb55
Documentation cleanup of basics.texi
Rik <rdrider0-list@yahoo.com>
parents:
9032
diff
changeset
|
1054 @subsection Single Line Comments |
57649dcecb55
Documentation cleanup of basics.texi
Rik <rdrider0-list@yahoo.com>
parents:
9032
diff
changeset
|
1055 @cindex @samp{#} |
57649dcecb55
Documentation cleanup of basics.texi
Rik <rdrider0-list@yahoo.com>
parents:
9032
diff
changeset
|
1056 @cindex @samp{%} |
57649dcecb55
Documentation cleanup of basics.texi
Rik <rdrider0-list@yahoo.com>
parents:
9032
diff
changeset
|
1057 |
3294 | 1058 In the Octave language, a comment starts with either the sharp sign |
1059 character, @samp{#}, or the percent symbol @samp{%} and continues to the | |
9035
57649dcecb55
Documentation cleanup of basics.texi
Rik <rdrider0-list@yahoo.com>
parents:
9032
diff
changeset
|
1060 end of the line. Any text following the sharp sign or percent symbol is |
57649dcecb55
Documentation cleanup of basics.texi
Rik <rdrider0-list@yahoo.com>
parents:
9032
diff
changeset
|
1061 ignored by the Octave interpreter and not executed. The following example |
57649dcecb55
Documentation cleanup of basics.texi
Rik <rdrider0-list@yahoo.com>
parents:
9032
diff
changeset
|
1062 shows whole line and partial line comments. |
10828
322f43e0e170
Grammarcheck .txi documentation files.
Rik <octave@nomad.inbox5.com>
parents:
10613
diff
changeset
|
1063 |
9035
57649dcecb55
Documentation cleanup of basics.texi
Rik <rdrider0-list@yahoo.com>
parents:
9032
diff
changeset
|
1064 @example |
57649dcecb55
Documentation cleanup of basics.texi
Rik <rdrider0-list@yahoo.com>
parents:
9032
diff
changeset
|
1065 @group |
57649dcecb55
Documentation cleanup of basics.texi
Rik <rdrider0-list@yahoo.com>
parents:
9032
diff
changeset
|
1066 function countdown |
57649dcecb55
Documentation cleanup of basics.texi
Rik <rdrider0-list@yahoo.com>
parents:
9032
diff
changeset
|
1067 # Count down for main rocket engines |
14856
c3fd61c59e9c
maint: Use Octave coding conventions for cuddling parentheses in doc directory
Rik <octave@nomad.inbox5.com>
parents:
14618
diff
changeset
|
1068 disp (3); |
c3fd61c59e9c
maint: Use Octave coding conventions for cuddling parentheses in doc directory
Rik <octave@nomad.inbox5.com>
parents:
14618
diff
changeset
|
1069 disp (2); |
c3fd61c59e9c
maint: Use Octave coding conventions for cuddling parentheses in doc directory
Rik <octave@nomad.inbox5.com>
parents:
14618
diff
changeset
|
1070 disp (1); |
c3fd61c59e9c
maint: Use Octave coding conventions for cuddling parentheses in doc directory
Rik <octave@nomad.inbox5.com>
parents:
14618
diff
changeset
|
1071 disp ("Blast Off!"); # Rocket leaves pad |
9035
57649dcecb55
Documentation cleanup of basics.texi
Rik <rdrider0-list@yahoo.com>
parents:
9032
diff
changeset
|
1072 endfunction |
57649dcecb55
Documentation cleanup of basics.texi
Rik <rdrider0-list@yahoo.com>
parents:
9032
diff
changeset
|
1073 @end group |
57649dcecb55
Documentation cleanup of basics.texi
Rik <rdrider0-list@yahoo.com>
parents:
9032
diff
changeset
|
1074 @end example |
57649dcecb55
Documentation cleanup of basics.texi
Rik <rdrider0-list@yahoo.com>
parents:
9032
diff
changeset
|
1075 |
57649dcecb55
Documentation cleanup of basics.texi
Rik <rdrider0-list@yahoo.com>
parents:
9032
diff
changeset
|
1076 @node Block Comments |
57649dcecb55
Documentation cleanup of basics.texi
Rik <rdrider0-list@yahoo.com>
parents:
9032
diff
changeset
|
1077 @subsection Block Comments |
9135
b04f95fabbf9
Update sections 2.5, 2.6, 2.7 of basics.txi
Rik <rdrider0-list@yahoo.com>
parents:
9134
diff
changeset
|
1078 @cindex block comments |
9035
57649dcecb55
Documentation cleanup of basics.texi
Rik <rdrider0-list@yahoo.com>
parents:
9032
diff
changeset
|
1079 @cindex multi-line comments |
57649dcecb55
Documentation cleanup of basics.texi
Rik <rdrider0-list@yahoo.com>
parents:
9032
diff
changeset
|
1080 @cindex @samp{#@{} |
57649dcecb55
Documentation cleanup of basics.texi
Rik <rdrider0-list@yahoo.com>
parents:
9032
diff
changeset
|
1081 @cindex @samp{%@{} |
3294 | 1082 |
9035
57649dcecb55
Documentation cleanup of basics.texi
Rik <rdrider0-list@yahoo.com>
parents:
9032
diff
changeset
|
1083 Entire blocks of code can be commented by enclosing the code between |
57649dcecb55
Documentation cleanup of basics.texi
Rik <rdrider0-list@yahoo.com>
parents:
9032
diff
changeset
|
1084 matching @samp{#@{} and @samp{#@}} or @samp{%@{} and @samp{%@}} markers. |
57649dcecb55
Documentation cleanup of basics.texi
Rik <rdrider0-list@yahoo.com>
parents:
9032
diff
changeset
|
1085 For example, |
10828
322f43e0e170
Grammarcheck .txi documentation files.
Rik <octave@nomad.inbox5.com>
parents:
10613
diff
changeset
|
1086 |
9035
57649dcecb55
Documentation cleanup of basics.texi
Rik <rdrider0-list@yahoo.com>
parents:
9032
diff
changeset
|
1087 @example |
57649dcecb55
Documentation cleanup of basics.texi
Rik <rdrider0-list@yahoo.com>
parents:
9032
diff
changeset
|
1088 @group |
57649dcecb55
Documentation cleanup of basics.texi
Rik <rdrider0-list@yahoo.com>
parents:
9032
diff
changeset
|
1089 function quick_countdown |
57649dcecb55
Documentation cleanup of basics.texi
Rik <rdrider0-list@yahoo.com>
parents:
9032
diff
changeset
|
1090 # Count down for main rocket engines |
14856
c3fd61c59e9c
maint: Use Octave coding conventions for cuddling parentheses in doc directory
Rik <octave@nomad.inbox5.com>
parents:
14618
diff
changeset
|
1091 disp (3); |
9035
57649dcecb55
Documentation cleanup of basics.texi
Rik <rdrider0-list@yahoo.com>
parents:
9032
diff
changeset
|
1092 #@{ |
14856
c3fd61c59e9c
maint: Use Octave coding conventions for cuddling parentheses in doc directory
Rik <octave@nomad.inbox5.com>
parents:
14618
diff
changeset
|
1093 disp (2); |
c3fd61c59e9c
maint: Use Octave coding conventions for cuddling parentheses in doc directory
Rik <octave@nomad.inbox5.com>
parents:
14618
diff
changeset
|
1094 disp (1); |
9035
57649dcecb55
Documentation cleanup of basics.texi
Rik <rdrider0-list@yahoo.com>
parents:
9032
diff
changeset
|
1095 #@} |
14856
c3fd61c59e9c
maint: Use Octave coding conventions for cuddling parentheses in doc directory
Rik <octave@nomad.inbox5.com>
parents:
14618
diff
changeset
|
1096 disp ("Blast Off!"); # Rocket leaves pad |
9035
57649dcecb55
Documentation cleanup of basics.texi
Rik <rdrider0-list@yahoo.com>
parents:
9032
diff
changeset
|
1097 endfunction |
57649dcecb55
Documentation cleanup of basics.texi
Rik <rdrider0-list@yahoo.com>
parents:
9032
diff
changeset
|
1098 @end group |
57649dcecb55
Documentation cleanup of basics.texi
Rik <rdrider0-list@yahoo.com>
parents:
9032
diff
changeset
|
1099 @end example |
57649dcecb55
Documentation cleanup of basics.texi
Rik <rdrider0-list@yahoo.com>
parents:
9032
diff
changeset
|
1100 |
57649dcecb55
Documentation cleanup of basics.texi
Rik <rdrider0-list@yahoo.com>
parents:
9032
diff
changeset
|
1101 @noindent |
17281
bc924baa2c4e
doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents:
17170
diff
changeset
|
1102 will produce a very quick countdown from @qcode{'3'} to @qcode{"Blast Off"} as |
bc924baa2c4e
doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents:
17170
diff
changeset
|
1103 the lines "@code{disp (2);}" and "@code{disp (1);}" won't be executed. |
9035
57649dcecb55
Documentation cleanup of basics.texi
Rik <rdrider0-list@yahoo.com>
parents:
9032
diff
changeset
|
1104 |
12680
1acead61c527
doc: Document that block comment markers must appear alone on a line (bug #33297)
Rik <octave@nomad.inbox5.com>
parents:
12545
diff
changeset
|
1105 The block comment markers must appear alone as the only characters on a line |
14038
b0cdd60db5e5
doc: Grammarcheck documentation ahead of 3.6.0 release.
Rik <octave@nomad.inbox5.com>
parents:
12691
diff
changeset
|
1106 (excepting whitespace) in order to be parsed correctly. |
12680
1acead61c527
doc: Document that block comment markers must appear alone on a line (bug #33297)
Rik <octave@nomad.inbox5.com>
parents:
12545
diff
changeset
|
1107 |
9035
57649dcecb55
Documentation cleanup of basics.texi
Rik <rdrider0-list@yahoo.com>
parents:
9032
diff
changeset
|
1108 @node Comments and the Help System |
57649dcecb55
Documentation cleanup of basics.texi
Rik <rdrider0-list@yahoo.com>
parents:
9032
diff
changeset
|
1109 @subsection Comments and the Help System |
57649dcecb55
Documentation cleanup of basics.texi
Rik <rdrider0-list@yahoo.com>
parents:
9032
diff
changeset
|
1110 @cindex documenting functions |
57649dcecb55
Documentation cleanup of basics.texi
Rik <rdrider0-list@yahoo.com>
parents:
9032
diff
changeset
|
1111 @cindex documenting user scripts |
57649dcecb55
Documentation cleanup of basics.texi
Rik <rdrider0-list@yahoo.com>
parents:
9032
diff
changeset
|
1112 @cindex help, user-defined functions |
57649dcecb55
Documentation cleanup of basics.texi
Rik <rdrider0-list@yahoo.com>
parents:
9032
diff
changeset
|
1113 |
57649dcecb55
Documentation cleanup of basics.texi
Rik <rdrider0-list@yahoo.com>
parents:
9032
diff
changeset
|
1114 The @code{help} command (@pxref{Getting Help}) is able to find the first |
9135
b04f95fabbf9
Update sections 2.5, 2.6, 2.7 of basics.txi
Rik <rdrider0-list@yahoo.com>
parents:
9134
diff
changeset
|
1115 block of comments in a function and return those as a documentation |
b04f95fabbf9
Update sections 2.5, 2.6, 2.7 of basics.txi
Rik <rdrider0-list@yahoo.com>
parents:
9134
diff
changeset
|
1116 string. This means that the same commands used to get help |
b04f95fabbf9
Update sections 2.5, 2.6, 2.7 of basics.txi
Rik <rdrider0-list@yahoo.com>
parents:
9134
diff
changeset
|
1117 on built-in functions are available for properly formatted user-defined |
b04f95fabbf9
Update sections 2.5, 2.6, 2.7 of basics.txi
Rik <rdrider0-list@yahoo.com>
parents:
9134
diff
changeset
|
1118 functions. For example, after defining the function @code{f} below, |
10828
322f43e0e170
Grammarcheck .txi documentation files.
Rik <octave@nomad.inbox5.com>
parents:
10613
diff
changeset
|
1119 |
3294 | 1120 @example |
1121 @group | |
1122 function xdot = f (x, t) | |
1123 | |
1124 # usage: f (x, t) | |
1125 # | |
9035
57649dcecb55
Documentation cleanup of basics.texi
Rik <rdrider0-list@yahoo.com>
parents:
9032
diff
changeset
|
1126 # This function defines the right-hand |
3294 | 1127 # side functions for a set of nonlinear |
1128 # differential equations. | |
1129 | |
1130 r = 0.25; | |
1131 @dots{} | |
1132 endfunction | |
1133 @end group | |
1134 @end example | |
1135 | |
10846
a4f482e66b65
Grammarcheck more of the documentation.
Rik <octave@nomad.inbox5.com>
parents:
10828
diff
changeset
|
1136 @noindent |
3294 | 1137 the command @kbd{help f} produces the output |
1138 | |
1139 @example | |
1140 @group | |
1141 usage: f (x, t) | |
1142 | |
9035
57649dcecb55
Documentation cleanup of basics.texi
Rik <rdrider0-list@yahoo.com>
parents:
9032
diff
changeset
|
1143 This function defines the right-hand |
3294 | 1144 side functions for a set of nonlinear |
1145 differential equations. | |
1146 @end group | |
1147 @end example | |
1148 | |
9135
b04f95fabbf9
Update sections 2.5, 2.6, 2.7 of basics.txi
Rik <rdrider0-list@yahoo.com>
parents:
9134
diff
changeset
|
1149 Although it is possible to put comment lines into keyboard-composed, |
b04f95fabbf9
Update sections 2.5, 2.6, 2.7 of basics.txi
Rik <rdrider0-list@yahoo.com>
parents:
9134
diff
changeset
|
1150 throw-away Octave programs, it usually isn't very useful because the |
3294 | 1151 purpose of a comment is to help you or another person understand the |
1152 program at a later time. | |
1153 | |
9035
57649dcecb55
Documentation cleanup of basics.texi
Rik <rdrider0-list@yahoo.com>
parents:
9032
diff
changeset
|
1154 The @code{help} parser currently only recognizes single line comments |
57649dcecb55
Documentation cleanup of basics.texi
Rik <rdrider0-list@yahoo.com>
parents:
9032
diff
changeset
|
1155 (@pxref{Single Line Comments}) and not block comments for the initial |
57649dcecb55
Documentation cleanup of basics.texi
Rik <rdrider0-list@yahoo.com>
parents:
9032
diff
changeset
|
1156 help text. |