In many circumstances, I find -c_local- a useful
alternative. -c_local- is not documented but
is used quite frequently in StataCorp programs,
as a -grep- or equivalent of the official ado
files will show.
In practice, fair criteria of whether you
should use -c_local- are that
1. you can work out from examples what the
syntax is and what it does
2. you can also work out why it means that
you can mess up your own programs
3. it looks appropriate to your problem.
Nick
[email protected]
Nick Winter
> You should read up on saving results in [U] 21.10.
>
> The short version is that for returning value(s), usually you
> do an rclass program:
Ian Watson
> >If I use
> >a sub-routine inside a main program I can pass it arguments no
> >problem. But after doing some transformations on the
> arguments, how can I
> >send the results back to the main program? If I declare new local
> >macros to store the results, they disappear when I return to the main
> >program (because they're no longer in scope). If I declare global
> >macros, I can access the results back in the main program, but I'm
> >left with a lot of global macros. This appears to me bad
> practice, andalso requires lots of dropping of global macros on exit etc.
> >
*
* 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/