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: Command accepts only global macros


From   Kohvakka Roosa <[email protected]>
To   "[email protected]" <[email protected]>
Subject   RE: st: Command accepts only global macros
Date   Thu, 31 May 2012 10:37:11 +0300

This is 100 % true (that "there does not seem to be a problem with -mvdcmp- picking up the contents of a local macro"), and the problem I was facing yesterday was 100 % not logical. And today I replaced all the global macros back to local for a portion of my do-file, and it works fine. So I don't know what went on yesterday since I haven't touched anything. I don't keep a log on that dofile (just store the outputs), so I cannot check whether the problem was specific to some other portion of that dofile. Will keep a log from now on, even if it will be 100 km long. But nevertheless, this problem I was having must have been to do with some faux pas in terms of logic, since that is the only possible explanation. No matter how "real" this problem seemed.

Let us rest this case.

-R


-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Joerg Luedicke
Sent: 30. toukokuuta 2012 19:37
To: [email protected]
Subject: Re: st: Command accepts only global macros

You neither say where -mvdcmp- is from and what version you use, nor
do you show what exactly went wrong (e.g., by showing what exactly you
did).

Assuming -mvdcmp- from SJ, version 10 from 2010/09/17 (run in Stata
11.2), there does not seem to be a problem with -mvdcmp- picking up
the contents of a local macro:

*------------------------------------
sysuse auto, clear

mvdcmp foreign: reg price mpg

loc vlist="price mpg"
mvdcmp foreign: reg `vlist'
*------------------------------------

J.


On Wed, May 30, 2012 at 8:03 AM, Kohvakka Roosa <[email protected]> wrote:
> Hi,
>
> Does anyone have any idea why some commands accept only global, and not local, macros in them? E.g. with  "regress" you can use local macros for the depvar and indep vars, no prob. But with this user-written command "mvdcmp" I am using (a decomposition) I can only define the dependent variable, indep variables and the estimation command using global macros.
>
> I can do this all right, just wondering why this is. Thanks.
>
> Roosa Kohvakka
> Researcher
>
> *
> *   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/

*
*   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/

*
*   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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index