⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 continue.hlp

📁 是一个经济学管理应用软件 很难找的 但是经济学学生又必须用到
💻 HLP
字号:
{smcl}
{* 08feb2005}{...}
{cmd:help continue}
{hline}

{title:Title}

{p2colset 5 21 23 2}{...}
{p2col :{hi:[P] continue} {hline 2}}Break out of loops{p_end}
{p2colreset}{...}


{title:Syntax}

	{cmd:continue} [{cmd:,} {cmdab:br:eak}]


{title:Description}

{pstd}
The {cmd:continue} command within a {cmd:foreach}, {cmd:forvalues}, or
{cmd:while} loop breaks execution of the current loop iteration and skips
the remaining commands within the loop.  Execution resumes at the top of the
loop unless the {cmd:break} option is specified, in which case,
execution resumes with the command following the looping command.  See
{helpb foreach}, {helpb forvalues}, and {helpb while} for a discussion of the
looping commands.


{title:Option}

{phang}
{cmd:break} indicates that the loop is to be exited.  The default
is to skip the remaining steps of the current iteration and to resume loop
execution again at the top of the loop.


{title:Examples}

	{cmd:forvalues x = 1/10} {cmd:{c -(}}
		{cmd:if mod(`x',2)} {cmd:{c -(}}
			{cmd:display "`x' is odd"}
			{cmd:continue}
		{cmd:{c )-}}
		{cmd:display "`x' is even"}
	{cmd:{c )-}}

{pstd}would produce the same results as

	{cmd:forvalues x = 1/10} {cmd:{c -(}}
		{cmd:if mod(`x',2)} {cmd:{c -(}}
			{cmd:display "`x' is odd"}
		{cmd:{c )-}}
		{cmd:else} {cmd:{c -(}}
			{cmd:display "`x' is even"}
		{cmd:{c )-}}
	{cmd:{c )-}}


{pstd}The {cmd:break} option allows you to prematurely exit the loop.

	{cmd:forvalues x = 6/1000} {cmd:{c -(}}
		{cmd:if mod(`x',2)==0 & mod(`x',3)==0 & mod(`x',5)==0} {cmd:{c -(}}

			{cmd:di "The least common multiple of 2, 3, and 5 is `x'"}
			{cmd:continue, break}
		{cmd:{c )-}}
	{cmd:{c )-}}

{pstd}The loop is executed over the values of 6 to 30 instead of to 1000.


{title:Also see}

{psee}
Manual:  {bf:[P] continue}

{psee}
Online:  {helpb foreach}, {helpb forvalues}, {helpb while}; {help ifcmd}
{p_end}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -