I am attempting to write wrapper programs that allow me to type ston and stoff instead of set trace on and set trace off. I am using Stata 16 for unix. I have created the following files:
ston.ado:
Code:
program ston
    version 16
    set trace on
end
stoff.ado:
Code:
program stoff
    version 16
    set trace off
end
However, these do not have the desired effect. Starting with trace set to off, I can issue the command ston as many times as I like and no output is produced. If I instead set trace on[/CODE], then I can call either ston or stoff as many times as I like and I get the output:
Code:
------------------------------------------------------------------------------------------------------------ begin ston ---
- version 16
- set trace on
-------------------------------------------------------------------------------------------------------------- end ston ---
or
Code:
----------------------------------------------------------------------------------------------------------- begin stoff ---
- version 16
- set trace off
------------------------------------------------------------------------------------------------------------- end stoff ---
every time.
I have searched for answers about simple wrappers and wrappers for set trace to no avail. Why doesn't this work as expected? Is there a better solution?