Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: RE: Preserve


From   Fred Wolfe <fwolfe@arthritis-research.org>
To   statalist@hsphsun2.harvard.edu, <statalist@hsphsun2.harvard.edu>
Subject   Re: st: RE: Preserve
Date   Fri, 21 Apr 2006 13:47:10 -0500

Thanks, Nick and Gary, both of whom suggested -restore,not-

At 01:06 PM 4/21/2006, Nick Cox wrote:
restore, not

However, I was not interested in not restoring only at the end of the ado file, but also in being able to restore later. Restore,not only cancels the restore at the end of the ado file. but doesn't allow it subsequently as this code shows.


program define testrestore
version 9.2
qui sysuse auto, clear
preserve
drop foreign
restore,not
end

Then:


. restore
nothing to restore
r(622);

. tab foreign
variable foreign not found
r(111);


What I wanted to do was to run program A which issues a preserve; run another program and then be able to restore.

What I have to do to get the behavior I want is:

Save a file
make changes
run other programs
reload the saved file - a manual preserve and restore.


Fred

Nick
n.j.cox@durham.ac.uk

Fred Wolfe

> -preserve- when run in an ado file restores at the end of the
> ado file. Is
> there any way to prevent the restore? This functionality is
> available in do files.

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

Fred Wolfe
National Data Bank for Rheumatic Diseases
Wichita, Kansas
Tel (316) 263-2125     Fax (316) 263-0761
fwolfe@arthritis-research.org


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