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

Re: st: Refresh an Ado file when is programing


From   Nick Winter <nw53@cornell.edu>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Refresh an Ado file when is programing
Date   Thu, 16 Dec 2004 10:55:17 -0500

The -discard- command will drop all *automatically* loaded programs; that is, programs loaded from an .ado file. It will not, however, drop user-entered programs, including those that are part of .do files. Consider:


. prog define nickprog
1. di "hello world"
2. end

. nickprog
hello world

. discard

. nickprog
hello world

. prog dir
78 nickprog
--------
78

. prog drop _all

. nickprog
unrecognized command: nickprog
r(199);

.


So, if your programs are in an .ado file, then -discard- should do it; if they are in a .do file or typed interactively, then you need to use -program drop-.

--Nick


At 02:20 PM 12/16/2004 +0000, you wrote:

-discard- as I understand it includes -program drop _all-.

Thus, next time this appears to happen, contact
tech-support. Either you have found a subtle bug, or
things are not what you think they are.

On the original question, there is a confusion. If
you change an .ado file with e.g. a text editor, it
is changed, just as you wish. It is the corresponding
program stored in memory that is not automatically
changed, nor should it be unless you say so, which
is why others are quite rightly pointing to -discard-
and -program drop-.

The text editors FAQ
http://fmwww.bc.edu/repec/bocode/t/textEditors.html
explains how you can build in an automatic -discard-
to use of your favourite text editor.

Ricardo Ovaldia replied to Xavi Barber

> > I'm programing my first ADO file.
> >
> > If  I change one line in my program, my ado file
> don't refresh, then I
> > shut down Stata and return to the first step.
> >
> > Do it exist a "refresh" command????

I find that sometimes -discard- does not always work,
so I like using -program drop _all- instead.

I am not sure why -discard- sometimes fails to clear
the program from memory, but -program drop _all-
always works.

*
*   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/
--------------------------------------------------------
Nicholas Winter 607.255.8819 t
Assistant Professor 607.255.4530 f
Department of Government nw53@cornell.edu e
308 White Hall falcon.arts.cornell.edu/nw53 w
Cornell University
Ithaca, NY 14853-4601

*
* 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