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

Re: st: RE: cutting out of a .ado file


From   "NEYMOTIN, FLORENCE" <[email protected]>
To   [email protected]
Subject   Re: st: RE: cutting out of a .ado file
Date   Thu, 30 Jun 2005 13:51:38 -0700

thanks! I'll try that.
florence

On Thu, 30 Jun 2005 21:12:52 +0100
 "Nick Cox" <[email protected]> wrote:
program define sample

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

end

Nick [email protected]
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/
*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index