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

st: programming question


From   Allan Garland <[email protected]>
To   [email protected]
Subject   st: programming question
Date   Thu, 15 Dec 2005 08:35:23 -0500

I have what should be a very simple Stata programming question that is vexing me.

I'm use the debugging command -trace- a lot and am annoyed by having to type "set trace on" and "set trace off" over and over from the command prompt. So, I tried to make a simple pair of ado files that would do that for me but with less typing, i.e. new commands -ton- to turn trace on, and -tof- to turn trace off:

capture program drop ton
program define ton
version 9.1
set trace on
end


capture program drop tof
program define tof
version 9.1
set trace off
end

However, when I run these it doesn't have the desired effect. In particular, I found that if I add Stata commands to the ado file -ton- after the line "set trace on" that indeed it traces them. But once it finishes reading and executing -ton-, trace seems to be set back to OFF. Thus, these "set trace" commands given with the ado files don't seem to "stick" after the ado file execution is completed.
Advise will be greatly appreciated.

Allan


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