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

RE: st: proceeding beyond roctab 2000 error msg - correction

From   "Nick Cox" <>
To   <>
Subject   RE: st: proceeding beyond roctab 2000 error msg - correction
Date   Wed, 2 Jun 2004 10:16:20 +0100

Me too, as it were. 

Yesterday I wrote: 

Yes. I don't think you need [P] to understand _rc. 

. whelp _rc 

gets you started. _rc is usually zero, whenever
a command works -- to Stata's satisfaction. If
you see a message like 

unrecognized command:  rgeress

r(199) is _rc of 199 in another guise. 

This was wrong. _rc is not just another 
way of reporting return codes. 

Gary Longton and David Kantor gave
the correct answer. 


Michael Blasnik
> You're right.  I have always assumed that the error code 
> shown after an
> error is put in _rc, but it isn't -- you learn something new 
> every day.
> This explains some previous wondering on my part when I find 
> nonzero return
> codes after executing ados that ran without an error. I now 
> realize that
> these were captured inside the ado -- a potentially confusing 
> feature when
> you see a nonzero _rc after running the ado because of a line 
> like -cap
> confirm string var xxx -.

Gary Longton 
> > I think that David was actually correct: _rc is a system 
> scalar holding
> the
> > return code from the most recent -capture- command.  See [U]16.4 or
> convince
> > yourself by displaying (-display _rc-) after any erroneous 
> Stata command
> used
> > without -capture-.
> > Though a Stata command may return a variety of error codes, 
> the code will
> not be
> > "captured" in the scalar _rc unless -capture- precedes that command.

*   For searches and help try:

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