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 on April 23, and its replacement, statalist.org is already up and running.


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

st: RE: How do I use a local within a global?


From   philippe van kerm <philippe.vankerm@ceps.lu>
To   "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu>
Subject   st: RE: How do I use a local within a global?
Date   Thu, 5 May 2011 11:15:30 +0000

di ${a_`z'}


NB: check section "18.3.4 Macros and expressions" of the users guide about using
	global a_b "Thank you Stata Users" 
	and
	local z "b"
instead of
	global a_b = "Thank you Stata Users" 
	and
	local z = "b"


Philippe


> -----Message d'origine-----
> De : owner-statalist@hsphsun2.harvard.edu [mailto:owner-
> statalist@hsphsun2.harvard.edu] De la part de Christian Lehmann
> Envoyé : Thursday, May 05, 2011 12:44 PM
> À : statalist@hsphsun2.harvard.edu
> Objet : st: How do I use a local within a global?
> 
> Dear Stata Users,
> 
> How do I use a local within a global?
> 
> Take the following example. I want to use the local z to call the
> global a_b
> 
> global a_b="Thank you Stata Users"
> local z="b"
> di "$a_`z'"
> 
> Stata would display "b" instead of the desired result  "Thank you Stata
> Users".
> 
> Thank you!
> 
> Chris
> *
> *   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/

Attention, nouvelle adresse a partir du 15 avril 2011 :
CEPS/INSTEAD
3, avenue de la Fonte
L-4364 Esch-sur-Alzette

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