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

. prog drop _all

. nickprog
unrecognized command: nickprog


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


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
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:
Nicholas Winter 607.255.8819 t
Assistant Professor 607.255.4530 f
Department of Government e
308 White Hall w
Cornell University
Ithaca, NY 14853-4601

* For searches and help try:

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