Edit: After some testing, it appears to be a scope issue; set trace on applies only to the context of the wrapper program. So, is there any way to make the effect of set trace apply globally?
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:
stoff.ado:
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:
or
every time. [Edit: So the programs are acknowledged and executed but with no apparent effect, at least with respect to the command window where I am typing interactively. Could it be a scope issue? That would surprise me.]
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?
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
Code:
program stoff version 16 set trace off end
Code:
------------------------------------------------------------------------------------------------------------ begin ston --- - version 16 - set trace on -------------------------------------------------------------------------------------------------------------- end ston ---
Code:
----------------------------------------------------------------------------------------------------------- begin stoff --- - version 16 - set trace off ------------------------------------------------------------------------------------------------------------- end stoff ---
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?
Comment