Bookmark and Share

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

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

st: -choke-

From   E Michael Foster <>
To   "" <>
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
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
yet, if I use -cap- execution proceeds.


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:

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