📄 m2_continue.hlp
字号:
{smcl}
{* 18mar2005}{...}
{cmd:help m2 continue}
{hline}
{* index for tt}{...}
{* index while tt}{...}
{* index do ... while tt}{...}
{title:Title}
{p 4 4 2}
{bf:[M-2] continue -- Continue with next iteration of for, while, or do loop}
{title:Syntax}
{cmd:for}, {cmd:while}, {it:or} {cmd:do {c -(}}
...
{cmd:if (}...{cmd:) {c -(}}
...
{cmd:continue}
{cmd:{c )-}}
...
{cmd:{c )-}}
...
{title:Description}
{p 4 4 2}
{cmd:continue} restarts the innermost {cmd:for}, {cmd:while}, or {cmd:do}
loop. Execution continues just as if the loop had reached its logical end.
{p 4 4 2}
{cmd:continue} nearly always occurs following an {cmd:if}.
{title:Remarks}
{p 4 4 2}
The following two code fragments are equivalent:
{cmd}for (i=1; i<=rows(A); i++) {
for (j=1; j<=cols(A); j++) {
if (i==j) continue
{txt}... action to be performed on A[i,j] ...{cmd}
}
}{txt}
{p 4 4 2}
and
{cmd}for (i=1; i<=rows(A); i++) {
for (j=1; j<=cols(A); j++) {
if (i!=j) {
{txt}... action to be performed on A[i,j] ...{cmd}
}
}
}{txt}
{p 4 4 2}
Note that {cmd:continue} operates on the innermost {cmd:for} or {cmd:while}
loop and that, even when the {cmd:continue} action is taken, standard
end-of-loop processing takes place (which is {cmd:j++} is this case).
{title:Also see}
{p 4 13 2}
Manual: {hi:[M-2] continue}
{p 4 13 2}
Online: help for
{bf:{help m2_do:[M-2] do}},
{bf:{help m2_for:[M-2] for}},
{bf:{help m2_while:[M-2] while}},
{bf:{help m2_break:[M-2] break}};
{bf:{help m2_intro:[M-2] intro}}
{p_end}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -