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.