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: Why do `test' and a`test' make a difference?


From   Dirk Enzmann <dirk.enzmann@uni-hamburg.de>
To   statalist@hsphsun2.harvard.edu
Subject   st: Why do `test' and a`test' make a difference?
Date   Sun, 10 Feb 2013 14:18:28 +0100

Why does the backslash as part of the global macro $path vanish (and `test' is not evaluated as a local macro) when immediately combined with the local macro `test', although it does not vanish (and the content of `test' is displayed) when not immediately combined as shown in the two variants of -di- in the example below?

* --- Stata example start: -----------

global path = "d:\my folder\"
local test = "pre_"
di "${path}`test'my name.dta"
di "${path}a`test'my name.dta"

* --- End Stata example. ------------

Dirk

========================================
Dr. Dirk Enzmann
Institute of Criminal Sciences
Dept. of Criminology
Rothenbaumchaussee 33
D-20148 Hamburg
Germany

phone: +49-(0)40-42838.7498 (office)
       +49-(0)40-42838.4591 (Mrs Billon)
fax:   +49-(0)40-42838.2344
email: dirk.enzmann@uni-hamburg.de
http://www2.jura.uni-hamburg.de/instkrim/kriminologie/Mitarbeiter/Enzmann/Enzmann.html
========================================
*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index