Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | Phil Schumm <pschumm@uchicago.edu> |
To | <statalist@hsphsun2.harvard.edu> |
Subject | Re: st: Capture break in mata |
Date | Wed, 2 Oct 2013 03:17:03 -0500 |
On Oct 1, 2013, at 6:25 PM, James Fiedler <jrfiedler@gmail.com> wrote: > I also tried > > real scalar myfunc() { > real scalar bk, i, j > > bk = setbreakintr(0) > i = 0 > while (!breakkey() & i++ < 1e8) { > for (j = 1; j <= 1e4; j++) { > } > } > > breakkeyreset() > (void) setbreakintr(bk) > > return(i) > } > > and couldn't get it to work. When I hit the break button, I get a popup saying "Break disallowed at this time". Maybe this depends on some setting in Stata? This appears to be Windows-specific behavior (i.e., I too am able to replicate what you describe under Windows). On OS X, it works as expected. Perhaps someone with more experience on Windows could comment. -- Phil * * 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/