Stephen P. Jenkins
> I am going through the code for -sureg- in detail (hoping
> to adapt some
> of it for my own uses!). (Similar code appears in related commands.)
> I have two queries:
> (1) Why is there no -markout- line to accompany the -markout- one?
> [Is it because this is handled via -reg3-, which
> -sureg- calls?]
> (2) What is the undocumented "c_local" command used in the
> short IsStop
> auxiliary programme used at the end? Can "local" be used
> instead? [The IsStop program in -reg3- is very similar, but
> uses local rather than c_local.] -findit c_local- is empty.
-c_local- inserts a local macro in the calling
program's macro space.
Consider
---------------------------- parent.ado
program def parent
version 7
Child
di "`Stephen'"
end
program def Child
version 7
c_local Stephen "Jenkins"
end
---------------------------
After calling -Child- from -parent-, the local
macro Stephen is defined.
This appears to be undocumented because
Stata Corp's programmers wanted it
for their own use -- and on occasion it
is mightily useful for communicating
between different programs without
leaving ugly globals all over the place --
but considered it too arcane or too
dangerous for general use.
Nick
[email protected]
*
* 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/