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]

Re: st: -choke-

From   Richard Williams <>
To, "" <>
Subject   Re: st: -choke-
Date   Thu, 12 Apr 2012 21:46:47 -0400

At 09:39 PM 4/12/2012, E Michael Foster wrote:
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.


Couldn't you just have an -exit- command?

Richard Williams, Notre Dame Dept of Sociology
OFFICE: (574)631-6668, (574)631-6463
HOME:   (574)289-5227
EMAIL:  Richard.A.Williams.5@ND.Edu

*   For searches and help try:

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