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]

st: -choke-


From   E Michael Foster <[email protected]>
To   "[email protected]" <[email protected]>
Subject   st: -choke-
Date   Fri, 13 Apr 2012 01:39:34 +0000

Whenever I change jobs (and that's not infrequently), my students encounter a programming command that surprises them.  It's my -choke- command. 
I stick it in code to run part of a do file and stop execution at a point in the code.  It returns an error and the student(s) think they've done something wrong.
I understand that I could submit part of a do-file by selecting it within the Stata do-file editor.  But I don't use it.  I use ultraedit.

So I think it's time to define chock.ado.

program define choke
     di "Mike says to stop!!!!"
     qui stoprightnow
     end
                
This doesn't quite work because I don't want anything other than "Mike says to stop!!!" in the log.  

I'd like to suppress the error message: 
       unrecognized command:  stoprightnow
       r(199);
yet, if I use -cap- execution proceeds.

Suggestions?



E. Michael Foster
Professor,            Department of Health Care Organization and Policy 
                                Department of Biostatistics
School of Public Health 
The University of Alabama at Birmingham 
  
Editor, Evaluation Review 

V: 205.934.6776
F: 815.550.1470
  
Mailing Address: 
RPHB 320 
1530 3RD AVE S 
Birmingham, AL 35294-0022 
  
Street Address: 
320 Ryals Public Health Building 
1665 University Boulevard 

"The Author of all things watches over me," Mattie concludes, "and I have a good horse"
True Grit


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


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index