Statalist


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

RE: st: Stepping through do file


From   "Buzz Burhans" <[email protected]>
To   <[email protected]>
Subject   RE: st: Stepping through do file
Date   Sat, 29 Mar 2008 11:51:40 -0400

Thanks Rajesh and Rich.  

I am aware -pause-, and have used it extensively to accomplish this - but I
have a set of do files that is thousands of lines of code long in total, and
some do files call other do files. Using -pause- requires huge amounts of
time to put in the pauses at the appropriate places over thousands of lines,
and then later I need to clean up the files and remove the pauses - I don't
want to remove all the pauses later, because a few are needed in the program
itself.

So another approach, such as Rajesh's mention of using -F8- in Excel, would
be helpful.  

Any other approaches to stepping through ??

Thanks

Buzz Burhans, Ph.D.

Dairy-Tech Group

Twin Falls, ID
Phone: 208-320-0829
Fax: 208-735-1289 

So. Albany VT
Phone: 802-755-6842

Email: [email protected]

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Rajesh Tharyan
Sent: Saturday, March 29, 2008 11:05 AM
To: [email protected]
Subject: RE: st: Stepping through do file

Hi,
With pause..

You have to set pause on

And then type pause in the do file where you want to pause. When you want it
to resume you have to press q. Is there a way to run a do file command by
command (without manually typing pause), pausing after each one and resuming
when prompted by the user by a key stroke? 

I know it can be done in other programs, for example, one that I know is
excel VBA where I can run VBA macro line by line by pressing f8.

rajesh



-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Richard Goldstein
Sent: 29 March 2008 14:39
To: [email protected]
Subject: Re: st: Stepping through do file

see help, or manual, for -pause-

Rich

Buzz Burhans wrote:
> Is there a way to step through a do file other than highlighting a line in
> the do file editor and running the selected lines?
> 
> I need to debug a set of do files.  I need to find places where my code is
> changing the data improperly - the files run ok, so -set trace on- does
not
> help the error trapping in this case.
> 
> I run repeated selections by highlighting them in the do file editor. If
> previous lines created a -tempfile- or local macro, it no longer exists
when
> I run later set of lines. For instance, if I select lines 1-10 and run
them,
> and a -tempfile- is created in those lines, when I later try to run lines
> further in the do file that use the -tempfile-, the -tempfile- no longer
> exists.
> 
> It would be really nice to step through a do file and keep it active
during
> the process, so local macros and tempfiles continued to be available in
the
> later lines.  
> 
> I am using Intercooled Stata 9.2; moving to 10 but haven't loaded it yet.
> Running on Win XP. 
> 
> Buzz Burhans, Ph.D.
> 
> Dairy-Tech Group
> 
> Twin Falls, ID
> Phone: 208-320-0829
> Fax: 208-735-1289 
> 
> So. Albany VT
> Phone: 802-755-6842
> 
> Email: [email protected]

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

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