Mercurial > octave-nkf
comparison doc/interpreter/stmt.txi @ 15684:ddc651eecf7a stable
Fix Info index for language statements (bug #37787)
* dynamic.txi, errors.txi, stmt.txi, vectorize.txi: Remove @code from all node
names, menus, and cross-references.
* octave.texi: Remove @code from menu for statements.
* ov-oncleanup.cc(Foncleanup): Remove @code from cross-reference in docstring.
author | Rik <rik@octave.org> |
---|---|
date | Wed, 28 Nov 2012 09:13:56 -0800 |
parents | 72c96de7a403 |
children | 18f8f2987205 |
comparison
equal
deleted
inserted
replaced
15622:7f4e7073b2e0 | 15684:ddc651eecf7a |
---|---|
44 The list of statements contained between keywords like @code{if} or | 44 The list of statements contained between keywords like @code{if} or |
45 @code{while} and the corresponding end statement is called the | 45 @code{while} and the corresponding end statement is called the |
46 @dfn{body} of a control statement. | 46 @dfn{body} of a control statement. |
47 | 47 |
48 @menu | 48 @menu |
49 * The @code{if} Statement:: | 49 * The if Statement:: |
50 * The @code{switch} Statement:: | 50 * The switch Statement:: |
51 * The @code{while} Statement:: | 51 * The while Statement:: |
52 * The @code{do-until} Statement:: | 52 * The do-until Statement:: |
53 * The @code{for} Statement:: | 53 * The for Statement:: |
54 * The @code{break} Statement:: | 54 * The break Statement:: |
55 * The @code{continue} Statement:: | 55 * The continue Statement:: |
56 * The @code{unwind_protect} Statement:: | 56 * The unwind_protect Statement:: |
57 * The @code{try} Statement:: | 57 * The try Statement:: |
58 * Continuation Lines:: | 58 * Continuation Lines:: |
59 @end menu | 59 @end menu |
60 | 60 |
61 @node The @code{if} Statement | 61 @node The if Statement |
62 @section The @code{if} Statement | 62 @section The if Statement |
63 @cindex @code{if} statement | 63 @cindex @code{if} statement |
64 @cindex @code{else} statement | 64 @cindex @code{else} statement |
65 @cindex @code{elseif} statement | 65 @cindex @code{elseif} statement |
66 @cindex @code{endif} statement | 66 @cindex @code{endif} statement |
67 | 67 |
205 | 205 |
206 @noindent | 206 @noindent |
207 using the indentation to show how Octave groups the statements. | 207 using the indentation to show how Octave groups the statements. |
208 @xref{Functions and Scripts}. | 208 @xref{Functions and Scripts}. |
209 | 209 |
210 @node The @code{switch} Statement | 210 @node The switch Statement |
211 @section The @code{switch} Statement | 211 @section The switch Statement |
212 @cindex @code{switch} statement | 212 @cindex @code{switch} statement |
213 @cindex @code{case} statement | 213 @cindex @code{case} statement |
214 @cindex @code{otherwise} statement | 214 @cindex @code{otherwise} statement |
215 @cindex @code{endswitch} statement | 215 @cindex @code{endswitch} statement |
216 | 216 |
383 @end group | 383 @end group |
384 @end example | 384 @end example |
385 | 385 |
386 @end itemize | 386 @end itemize |
387 | 387 |
388 @node The @code{while} Statement | 388 @node The while Statement |
389 @section The @code{while} Statement | 389 @section The while Statement |
390 @cindex @code{while} statement | 390 @cindex @code{while} statement |
391 @cindex @code{endwhile} statement | 391 @cindex @code{endwhile} statement |
392 @cindex loop | 392 @cindex loop |
393 @cindex body of a loop | 393 @cindex body of a loop |
394 | 394 |
452 | 452 |
453 A newline is not required between the condition and the | 453 A newline is not required between the condition and the |
454 body; but using one makes the program clearer unless the body is very | 454 body; but using one makes the program clearer unless the body is very |
455 simple. | 455 simple. |
456 | 456 |
457 @node The @code{do-until} Statement | 457 @node The do-until Statement |
458 @section The @code{do-until} Statement | 458 @section The do-until Statement |
459 @cindex @code{do-until} statement | 459 @cindex @code{do-until} statement |
460 | 460 |
461 The @code{do-until} statement is similar to the @code{while} statement, | 461 The @code{do-until} statement is similar to the @code{while} statement, |
462 except that it repeatedly executes a statement until a condition becomes | 462 except that it repeatedly executes a statement until a condition becomes |
463 true, and the test of the condition is at the end of the loop, so the | 463 true, and the test of the condition is at the end of the loop, so the |
499 | 499 |
500 A newline is not required between the @code{do} keyword and the | 500 A newline is not required between the @code{do} keyword and the |
501 body; but using one makes the program clearer unless the body is very | 501 body; but using one makes the program clearer unless the body is very |
502 simple. | 502 simple. |
503 | 503 |
504 @node The @code{for} Statement | 504 @node The for Statement |
505 @section The @code{for} Statement | 505 @section The for Statement |
506 @cindex @code{for} statement | 506 @cindex @code{for} statement |
507 @cindex @code{endfor} statement | 507 @cindex @code{endfor} statement |
508 | 508 |
509 The @code{for} statement makes it more convenient to count iterations of a | 509 The @code{for} statement makes it more convenient to count iterations of a |
510 loop. The general form of the @code{for} statement looks like this: | 510 loop. The general form of the @code{for} statement looks like this: |
656 The @var{key} variable may also be omitted. If it is, the brackets are | 656 The @var{key} variable may also be omitted. If it is, the brackets are |
657 also optional. This is useful for cycling through the values of all the | 657 also optional. This is useful for cycling through the values of all the |
658 structure elements when the names of the elements do not need to be | 658 structure elements when the names of the elements do not need to be |
659 known. | 659 known. |
660 | 660 |
661 @node The @code{break} Statement | 661 @node The break Statement |
662 @section The @code{break} Statement | 662 @section The break Statement |
663 @cindex @code{break} statement | 663 @cindex @code{break} statement |
664 | 664 |
665 The @code{break} statement jumps out of the innermost @code{for} or | 665 The @code{break} statement jumps out of the innermost @code{for} or |
666 @code{while} loop that encloses it. The @code{break} statement may only | 666 @code{while} loop that encloses it. The @code{break} statement may only |
667 be used within the body of a loop. The following example finds the | 667 be used within the body of a loop. The following example finds the |
711 endif | 711 endif |
712 endwhile | 712 endwhile |
713 @end group | 713 @end group |
714 @end example | 714 @end example |
715 | 715 |
716 @node The @code{continue} Statement | 716 @node The continue Statement |
717 @section The @code{continue} Statement | 717 @section The continue Statement |
718 @cindex @code{continue} statement | 718 @cindex @code{continue} statement |
719 | 719 |
720 The @code{continue} statement, like @code{break}, is used only inside | 720 The @code{continue} statement, like @code{break}, is used only inside |
721 @code{for} or @code{while} loops. It skips over the rest of the loop | 721 @code{for} or @code{while} loops. It skips over the rest of the loop |
722 body, causing the next cycle around the loop to begin immediately. | 722 body, causing the next cycle around the loop to begin immediately. |
760 endif | 760 endif |
761 endfor | 761 endfor |
762 @end group | 762 @end group |
763 @end example | 763 @end example |
764 | 764 |
765 @node The @code{unwind_protect} Statement | 765 @node The unwind_protect Statement |
766 @section The @code{unwind_protect} Statement | 766 @section The unwind_protect Statement |
767 @cindex @code{unwind_protect} statement | 767 @cindex @code{unwind_protect} statement |
768 @cindex @code{unwind_protect_cleanup} | 768 @cindex @code{unwind_protect_cleanup} |
769 @cindex @code{end_unwind_protect} | 769 @cindex @code{end_unwind_protect} |
770 | 770 |
771 Octave supports a limited form of exception handling modelled after the | 771 Octave supports a limited form of exception handling modelled after the |
811 would not be restored if an error occurs while evaluating the first part | 811 would not be restored if an error occurs while evaluating the first part |
812 of the @code{unwind_protect} block because evaluation would stop at the | 812 of the @code{unwind_protect} block because evaluation would stop at the |
813 point of the error and the statement to restore the value would not be | 813 point of the error and the statement to restore the value would not be |
814 executed. | 814 executed. |
815 | 815 |
816 @node The @code{try} Statement | 816 @node The try Statement |
817 @section The @code{try} Statement | 817 @section The try Statement |
818 @cindex @code{try} statement | 818 @cindex @code{try} statement |
819 @cindex @code{catch} | 819 @cindex @code{catch} |
820 @cindex @code{end_try_catch} | 820 @cindex @code{end_try_catch} |
821 | 821 |
822 In addition to unwind_protect, Octave supports another limited form of | 822 In addition to unwind_protect, Octave supports another limited form of |