Mercurial > forge
comparison extra/ver20/orient.m @ 0:6b33357c7561 octave-forge
Initial revision
author | pkienzle |
---|---|
date | Wed, 10 Oct 2001 19:54:49 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:6b33357c7561 |
---|---|
1 ## Copyright (C) 2001 Paul Kienzle | |
2 ## | |
3 ## This program is free software; you can redistribute it and/or modify | |
4 ## it under the terms of the GNU General Public License as published by | |
5 ## the Free Software Foundation; either version 2 of the License, or | |
6 ## (at your option) any later version. | |
7 ## | |
8 ## This program is distributed in the hope that it will be useful, | |
9 ## but WITHOUT ANY WARRANTY; without even the implied warranty of | |
10 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
11 ## GNU General Public License for more details. | |
12 ## | |
13 ## You should have received a copy of the GNU General Public License | |
14 ## along with this program; if not, write to the Free Software | |
15 ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
16 | |
17 ## orient("landscape"|"portrait") | |
18 ## Set default print orientation | |
19 ## | |
20 ## ret = orient | |
21 ## Return default print orientation | |
22 | |
23 function ret = orient(orientation) | |
24 | |
25 ## XXX FIXME XXX --- this should be static instead of global, but that | |
26 ## means it won't work in Octave 2.0 | |
27 global __print_orientation; | |
28 | |
29 if (nargin == 0) | |
30 | |
31 if !exist("__print_orientation") | |
32 ret = "landscape"; | |
33 else | |
34 ret = __print_orientation; | |
35 endif | |
36 | |
37 elseif (nargin == 1) | |
38 | |
39 if strcmp(orientation,"landscape") || strcmp(orienation,"portrait") | |
40 __print_orientation = orientation; | |
41 else | |
42 error ("orient: unknown orientation"); | |
43 endif | |
44 | |
45 else | |
46 | |
47 usage("orient(['portrait' | 'landscape']) OR ret=orient"); | |
48 | |
49 endif | |
50 | |
51 endfunction |