Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

Re: st: Terminating a loop with a value trigger


From   Jeph Herrin <[email protected]>
To   [email protected]
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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index