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

st: RE: inspecting loaded variables and programs


From   "John P. Haisken-DeNew" <[email protected]>
To   <[email protected]>
Subject   st: RE: inspecting loaded variables and programs
Date   Wed, 21 May 2003 17:47:52 +0200

Hi,

i'd try the "confirm" command to determine whether a variable exists.

As for determining whether an ado has already been loaded, why not just
type:

. capture program drop p

that just drops it by brute force, but doesn't care if it hasn't been
loaded yet.

Or you could write similarly:

. capture drop x

that'll kill the variable in the same way.

Cheers,
-john.



-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Pijus
Virketis
Sent: Wednesday, May 21, 2003 5:25 PM
To: [email protected]
Subject: st: inspecting loaded variables and programs

Dear all,

I am wondering what the stata-idiomatic way is to discover if a variable
"x" or a (non-.ado) program "p" is currently loaded. Sometimes in a .do
script I need to check if "x" and "p" already exist, and drop/replace
them if they do. 

Thank you!

Pijus

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