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
I would suggest looking at the code of rollreg.ado (available from
SSC). I received advice from Nick on the use of c_local in this context
to make the several repetitive components of this routine amenable to
subroutines. The way in which that logic works is fairly obvious from
the code: in this routine there is the need to deal with some options
that may or may not be defined, which complicates the issue (in terms
of traditional programming languages, the argument list is of variable
length).