Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

Re: st: -capture noisily- shorthand


From   annoporci <annoporci@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: -capture noisily- shorthand
Date   Wed, 16 Jan 2013 04:11:55 +0800

Got it, thanks Nick!!

Patrick.

---
Patrick Toche.


On Wed, 16 Jan 2013 03:10:43 +0800, Nick Cox <njcoxstata@gmail.com> wrote:

Your examples are logically also single-line commands. The
end-of-lines are commented out or made irrelevant.

What I meant was that -cn- as defined would not help with blocks of
command lines where you might have a desire to develop an alternative
to

capture noisily {
          ...
          ...
}

But the local macro approach will work fine here.

local cn "capture noisily"

...

`cn' {
         ...
         ...
}

As previously said, I don't recommend writing a program here. Using a
local macro is much superior, should you not like spelling out
"capture noisily". (I don't share the aversion either.)

Nick

On Tue, Jan 15, 2013 at 6:57 PM, annoporci <annoporci@gmail.com> wrote:
Dear Nick,

about the -cn- program:


program cn
           * no version number
            capture noisily `0'
end

But that will work only as a prefix to single-line commands.

Nick


I'm not sure what you mean by "single-line commands,"  As far as I
can tell, it's working well with what looks to me like a two-line command
(copy-pasted from an example I just ran):

cn arch `var' if inrange(date,mdy(1,1,2007),mdy(12,27,2012)) ///
          , arch(1) garch(1)

It also appears to be working on commands written over several lines but
with a semi-colon delimit (this one had over 15 lines but I cut some out).

     #delimit ;
     cn line `var'_ht_garch11 date
        ,
        ylabel(, angle(0) grid)
        xlabel(,format(%tdCY)labsize(small))
     ; #delimit cr


And thanks again.


--
Patrick Toche.
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


--
Patrick Toche.
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index