Mercurial > hg > octave-nkf
changeset 16053:119ce9f5e1a3
doc: Add seealso links between input, yes_or_no, kbhit.
* libinterp/interpfcn/input.cc(Finput): Add seealso link to yes_or_no, kbhit.
Add return argument to function documenation.
* libinterp/interpfcn/input.cc(Fyes_or_no): Add seealso link to input.
Redo docstring to make it more modern.
* libinterp/interpfcn/sysdep.cc(kbhit): Add seealso link to input.
Add second calling form of kbhit to documentation.
author | Rik <rik@octave.org> |
---|---|
date | Tue, 12 Feb 2013 08:13:46 -0800 |
parents | a59cb5c06d79 |
children | 5306e943ce74 |
files | libinterp/interpfcn/input.cc libinterp/interpfcn/sysdep.cc |
diffstat | 2 files changed, 18 insertions(+), 13 deletions(-) [+] |
line wrap: on
line diff
--- a/libinterp/interpfcn/input.cc +++ b/libinterp/interpfcn/input.cc @@ -843,8 +843,8 @@ DEFUN (input, args, nargout, "-*- texinfo -*-\n\ -@deftypefn {Built-in Function} {} input (@var{prompt})\n\ -@deftypefnx {Built-in Function} {} input (@var{prompt}, \"s\")\n\ +@deftypefn {Built-in Function} {@var{ans} =} input (@var{prompt})\n\ +@deftypefnx {Built-in Function} {@var{ans} =} input (@var{prompt}, \"s\")\n\ Print a prompt and wait for user input. For example,\n\ \n\ @example\n\ @@ -874,7 +874,8 @@ Because there may be output waiting to be displayed by the pager, it is\n\ a good idea to always call @code{fflush (stdout)} before calling\n\ @code{input}. This will ensure that all pending output is written to\n\ -the screen before your prompt. @xref{Input and Output}.\n\ +the screen before your prompt.\n\ +@seealso{yes_or_no, kbhit}\n\ @end deftypefn") { octave_value_list retval; @@ -909,12 +910,14 @@ DEFUN (yes_or_no, args, , "-*- texinfo -*-\n\ -@deftypefn {Built-in Function} {} yes_or_no (@var{prompt})\n\ -Ask the user a yes-or-no question. Return 1 if the answer is yes.\n\ -Takes one argument, which is the string to display to ask the\n\ -question. It should end in a space; @samp{yes-or-no-p} adds\n\ -@samp{(yes or no) } to it. The user must confirm the answer with\n\ -RET and can edit it until it has been confirmed.\n\ +@deftypefn {Built-in Function} {@var{ans} =} yes_or_no (\"@var{prompt}\")\n\ +Ask the user a yes-or-no question. Return logical true if the answer is yes\n\ +or false if the answer is no. Takes one argument, @var{prompt}, which is\n\ +the string to display when asking the question. @var{prompt} should end in\n\ +a space; @code{yes-or-no} adds the string @samp{(yes or no) } to it. The\n\ +user must confirm the answer with @key{RET} and can edit it until it has\n\ +been confirmed.\n\ +@seealso{input}\n\ @end deftypefn") { octave_value retval; @@ -986,7 +989,7 @@ DEFUN (keyboard, args, , "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} keyboard ()\n\ -@deftypefnx {Built-in Function} {} keyboard (@var{prompt})\n\ +@deftypefnx {Built-in Function} {} keyboard (\"@var{prompt}\")\n\ This function is normally used for simple debugging. When the\n\ @code{keyboard} function is executed, Octave prints a prompt and waits\n\ for user input. The input strings are then evaluated and the results\n\
--- a/libinterp/interpfcn/sysdep.cc +++ b/libinterp/interpfcn/sysdep.cc @@ -619,8 +619,9 @@ DEFUN (kbhit, args, , "-*- texinfo -*-\n\ -@deftypefn {Built-in Function} {} kbhit ()\n\ -Read a single keystroke from the keyboard. If called with one\n\ +@deftypefn {Built-in Function} {} kbhit ()\n\ +@deftypefnx {Built-in Function} {} kbhit (1)\n\ +Read a single keystroke from the keyboard. If called with an\n\ argument, don't wait for a keypress. For example,\n\ \n\ @example\n\ @@ -636,8 +637,9 @@ @end example\n\ \n\ @noindent\n\ -identical to the above example, but don't wait for a keypress,\n\ +is identical to the above example, but doesn't wait for a keypress,\n\ returning the empty string if no key is available.\n\ +@seealso{input}\n\ @end deftypefn") { octave_value retval;