3431
|
1 ## Copyright (C) 1996 Auburn University. All rights reserved. |
|
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 the |
|
7 ## Free Software Foundation; either version 2, or (at your option) any |
|
8 ## later version. |
|
9 ## |
|
10 ## Octave is distributed in the hope that it will be useful, but WITHOUT |
|
11 ## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
12 ## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
13 ## for more details. |
|
14 ## |
|
15 ## You should have received a copy of the GNU General Public License |
|
16 ## along with Octave; see the file COPYING. If not, write to the Free |
5307
|
17 ## Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
|
18 ## 02110-1301 USA. |
3431
|
19 |
|
20 ## -*- texinfo -*- |
5016
|
21 ## @deftypefn {Function File} {} prompt (@var{str}) |
3431
|
22 ## Prompt user to continue |
5016
|
23 ## |
|
24 ## @strong{Input} |
|
25 ## @table @var |
|
26 ## @item str |
|
27 ## Input string. Its default value is: |
|
28 ## @example |
|
29 ## \n ---- Press a key to continue --- |
|
30 ## @end example |
|
31 ## @end table |
3431
|
32 ## @end deftypefn |
|
33 |
|
34 ## Author: David Clem |
|
35 ## Created: August 15, 1994 |
|
36 ## Modified A. S. Hodel June 1995 |
|
37 |
|
38 function prompt (str) |
|
39 |
4462
|
40 if (nargin > 1) |
|
41 usage ("prompt ([str])"); |
|
42 elseif (nargin == 0) |
3431
|
43 str = "\n ---- Press a key to continue ---"; |
5443
|
44 elseif (! ischar (str) ) |
4462
|
45 error ("prompt: input must be a string"); |
3431
|
46 endif |
|
47 |
4462
|
48 disp (str); |
|
49 fflush (stdout); |
|
50 kbhit (); |
3431
|
51 |
|
52 endfunction |