7017
|
1 ## Copyright (C) 2004, 2005, 2006, 2007 John W. Eaton |
4691
|
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. |
4691
|
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/>. |
4691
|
18 |
|
19 ## -*- texinfo -*- |
6257
|
20 ## @deftypefn {Function File} {} delete (@var{file}) |
|
21 ## @deftypefnx {Function File} {} delete (@var{h}) |
|
22 ## Delete the named file or figure handle. |
4691
|
23 ## @end deftypefn |
|
24 |
|
25 ## PKG_ADD: mark_as_command delete |
|
26 |
|
27 ## Author: jwe |
|
28 |
6257
|
29 function delete (arg) |
4691
|
30 |
|
31 if (nargin == 1) |
6257
|
32 if (ischar (arg)) |
|
33 unlink (arg); |
6405
|
34 elseif (ishandle (arg)) |
|
35 ## Delete a graphics object. |
|
36 __go_delete__ (arg); |
6257
|
37 else |
6405
|
38 error ("delete: expecting argument to be a filename or graphics handle"); |
6257
|
39 endif |
4691
|
40 else |
6046
|
41 print_usage (); |
4691
|
42 endif |
|
43 |
|
44 endfunction |