changeset 15908:5a4a07a2ec73

doc: add while and do-until example to help text (bug #7915)
author Carnë Draug <carandraug+dev@gmail.com>
date Sun, 06 Jan 2013 21:59:11 +0000
parents 53ec9063dc6d
children 8e38eac05230
files libinterp/interpfcn/help.cc
diffstat 1 files changed, 21 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/interpfcn/help.cc	Sat Jan 05 18:40:49 2013 -0800
+++ b/libinterp/interpfcn/help.cc	Sun Jan 06 21:59:11 2013 +0000
@@ -478,7 +478,16 @@
 @deftypefn {Keyword} {} do\n\
 Begin a do-until loop.  This differs from a do-while loop in that the\n\
 body of the loop is executed at least once.\n\
-@seealso{while}\n\
+\n\
+@example\n\
+@group\n\
+i = 0;\n\
+do\n\
+  i++\n\
+until (i == 10)\n\
+@end group\n\
+@end example\n\
+@seealso{for, until, while}\n\
 @end deftypefn"),
 
   pair_type ("else",
@@ -708,7 +717,7 @@
   pair_type ("until",
     "-*- texinfo -*-\n\
 @deftypefn {Keyword} {} until\n\
-End a do-until loop.\n\
+End a do-until loop.  See @code{do} for an example.\n\
 @seealso{do}\n\
 @end deftypefn"),
 
@@ -751,7 +760,16 @@
     "-*- texinfo -*-\n\
 @deftypefn {Keyword} {} while\n\
 Begin a while loop.\n\
-@seealso{do}\n\
+\n\
+@example\n\
+@group\n\
+i = 0;\n\
+while (i < 10)\n\
+  i++\n\
+endwhile\n\
+@end group\n\
+@end example\n\
+@seealso{do, endwhile, for, until}\n\
 @end deftypefn"),
 };