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: here's another thing driving me nuts
From
Nick Cox <[email protected]>
To
[email protected]
Subject
Re: st: here's another thing driving me nuts
Date
Tue, 8 Mar 2011 09:07:40 +0000
-local- means exactly that. A local macro is only visible within the
same program in which it was defined.
Here program also means command session, do file, do-editor contents.
If you define a local macro using a standard command line, no program
can see it without further action.
Nick
On Tue, Mar 8, 2011 at 4:40 AM, Scott Talkington <[email protected]> wrote:
> Never mind, I think I have this figured out. The program works fine with
> arguments, so suspect the problem was with the choice of local variable
> names and entering them with the "loc" command to create macros. Arguments
> is an easier way to go, and more like what I wanted anyway.
>
>
> On 3/7/2011 11:13 PM, Scott Talkington wrote:
>>
>> Here I've defined the local variables x and y but the following line
>> within a program generates a syntax error while the same thing from the
>> command line does not:
>>
>> table var1 if var2~=`y', c(mean `x' n `x')
>>
>> in this case y is a number and x is a variable name.
>>
>> I don't understand why the program line generates an error and the command
>> line doesn't, where they're exactly the same??
*
* 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/