Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: cutting out of a .ado file


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: cutting out of a .ado file
Date   Thu, 30 Jun 2005 21:12:52 +0100

program define sample
 
if (condition)  {
	di as err "error message" 
	exit 42 
}
else {
	resume operation of the program...
	...
}

end

Nick 
n.j.cox@durham.ac.uk 

NEYMOTIN, FLORENCE
 
> Hi, what's the appropriate syntax if you want a .ado file to 
> cut out with an error message if a 
> particular condition is satisfied?  I thought that I could 
> just write "end" in the loop, but it 
> isn't liking it.  For instance, I wanted code to look like:
> -----------------------
> program define sample
> 
> if (condition)  {
> cut out of sample
> }
> else {
> resume operation of the program...
> ...
> }
> end
> -------------------------

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index