Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: Terminating a loop with a value trigger


From   Jeph Herrin <stata@spandrel.net>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Terminating a loop with a value trigger
Date   Sat, 30 Mar 2013 10:07:44 -0400

they don't allow an "if" option , but you can certainly add one:


 while `cond'>0 {
	...
	[make calculations]
	...
	if `mytest'==1 {
		continue, break
	}

 }


cheers,
Jeph

On 3/30/2013 9:33 AM, Stephen Cranney wrote:
Hi all,

Is there a way to continue a loop until a certain value is reached in
one of the calculations ? (Obviously not just until the macro hits a
certain point, but a calculation inside the loop that involves the
macro). As far as I can tell, "exit "and "continue, break" don't allow
some kind of "if" option.

Thanks in advance,

Stephen
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index