Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: 2 queries re code in -sureg-


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: 2 queries re code in -sureg-
Date   Tue, 8 Oct 2002 15:23:17 +0100

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/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index