| |
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
st: forward vs backward slash in path names
Dear statalisters,
I always thought that the "/" (slashes) can be either forward or
backward - Stata doesn't distinguish between them.
However, in the following case, they produce very different results:
foreach file in comp cons fami {;
capture use "$root/orig/`file'1976";
foreach num of numlist 1978(2)2004 {;
capture append using "$root/orig/`file'`num'";
};
};
works fine.
However, the backslash version "$root\orig\`file'`num'"
reads orig\`file'`num' as "orig`file'`num'" (a file which does not
exist), i.e. seems to ignore the backslash altogether.
Why is that?
Best, Sascha
--
Dr. Sascha O. Becker
Department of Economics
Main Office, Economics Building
University of California, San Diego
9500 Gilman Dr. Dept. 0508
La Jolla, CA 92093-0508, USA
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/