Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: st: Tracing loops
From
Joe Canner <[email protected]>
To
"[email protected]" <[email protected]>
Subject
RE: st: Tracing loops
Date
Fri, 27 Sep 2013 16:26:45 +0000
Billy,
Thanks for your response. I already looked into -set tracedepth #-. Intuitively, I would have assumed that a tracedepth of 1 would do what I want, but that just means it will go one level deep into the Stata ado-files instead of going farther down. Specifying a tracedepth of 0 results in an error. Am I missing something?
Here is a way to test:
. sysuse auto, clear
. set tracedepth 1
. set trace on
. foreach var of varlist * {
. codebook `var'
. }
. set trace off
Thanks,
Joe
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of William Buchanan
Sent: Friday, September 27, 2013 12:09 PM
To: [email protected]
Subject: Re: st: Tracing loops
See -help set tracedepth-. It might take a while, but you should be able to set things to either exactly what you want, or at least get very close.
HTH,
Billy
On Sep 27, 2013, at 11:00 AM, Joe Canner <[email protected]> wrote:
> Dear Statalist colleagues,
>
> Is there any way, as of Stata 12, to trace the execution of a -foreach- loop without Stata also tracing any ado-file based commands within the loop? I saw a post on this from 2009 and the only solution then was to save the trace to a log. This seems like a tedious and time consuming way to simply find out where an error occurred, follow the execution progress of a loop, and/or see what output goes with what commands.
>
> Is there anything new in Stata 13 that addresses this?
>
> Is there any conceivable way to program this some other way? Is this even a concern for anyone?
>
> Thanks,
> Joe Canner
> Johns Hopkins University School of Medicine
>
> *
> * For searches and help try:
> * http://www.stata.com/help.cgi?search
> * http://www.stata.com/support/faqs/resources/statalist-faq/
> * http://www.ats.ucla.edu/stat/stata/
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/faqs/resources/statalist-faq/
* http://www.ats.ucla.edu/stat/stata/
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/faqs/resources/statalist-faq/
* http://www.ats.ucla.edu/stat/stata/