Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: Dropping Program Saved as an ado-file


From   Nick Cox <njcoxstata@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Dropping Program Saved as an ado-file
Date   Wed, 5 Sep 2012 13:56:34 +0100

An alternative is to pass the names of temporary variables via an
option. If you have

tempvar foobar
gen `foobar' = ...

you can call a subprogram with

... foobar(`foobar')

This requires care, but so does sharing names via a global. For
example, that global will stick around with inbuilt potential to mess
up other things if you are not careful.

Nick

On Wed, Sep 5, 2012 at 10:26 AM, Maarten Buis <maartenlbuis@gmail.com> wrote:
> On Wed, Sep 5, 2012 at 11:20 AM, Maarten Buis wrote:
>>         di as txt "Dispay summary of " as result "yvar"
>>         sum $yvar
>>
>>         di _n as txt "Dislay summary of " as result "xvars"
>>         sum $xvars
>
> hmm... this is obviously not a good example if one wants to learn how
> to spell "Display".
>
> However, I guess (and hope) people interested in such issue won't go
> to the Statalist.
>
>
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index