Mercurial > hg > octave-nkf
annotate scripts/io/beep.m @ 13041:e5a49b2f8225
codesprint: Single input validation test for beep.m
* beep.m: Check number of inputs is correct.
author | Rik <octave@nomad.inbox5.com> |
---|---|
date | Sat, 03 Sep 2011 07:58:26 -0700 |
parents | fd0a3ac60b0e |
children | 72c96de7a403 |
rev | line source |
---|---|
11523 | 1 ## Copyright (C) 2003-2011 John W. Eaton |
4263 | 2 ## |
3 ## This file is part of Octave. | |
4 ## | |
5 ## Octave is free software; you can redistribute it and/or modify it | |
6 ## under the terms of the GNU General Public License as published by | |
7016 | 7 ## the Free Software Foundation; either version 3 of the License, or (at |
8 ## your option) any later version. | |
4263 | 9 ## |
10 ## Octave is distributed in the hope that it will be useful, but | |
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
13 ## General Public License for more details. | |
14 ## | |
15 ## You should have received a copy of the GNU General Public License | |
7016 | 16 ## along with Octave; see the file COPYING. If not, see |
17 ## <http://www.gnu.org/licenses/>. | |
4263 | 18 |
19 ## -*- texinfo -*- | |
6567 | 20 ## @deftypefn {Function File} {} beep () |
4293 | 21 ## Produce a beep from the speaker (or visual bell). |
5642 | 22 ## @seealso{puts, fputs, printf, fprintf} |
4263 | 23 ## @end deftypefn |
24 | |
25 ## Author: jwe | |
26 | |
27 function beep () | |
28 | |
13041
e5a49b2f8225
codesprint: Single input validation test for beep.m
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
29 if (nargin != 0) |
6046 | 30 print_usage (); |
4268 | 31 endif |
4263 | 32 |
13041
e5a49b2f8225
codesprint: Single input validation test for beep.m
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
33 puts ("\a"); |
e5a49b2f8225
codesprint: Single input validation test for beep.m
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
34 |
4263 | 35 endfunction |
13041
e5a49b2f8225
codesprint: Single input validation test for beep.m
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
36 |
e5a49b2f8225
codesprint: Single input validation test for beep.m
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
37 |
e5a49b2f8225
codesprint: Single input validation test for beep.m
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
38 %!error (beep (1)) |