Statalist


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

RE: st: RE: RE: RE: RE: RE: RE: RE: global macro for system directory?


From   martin.weiss1@gmx.de
To   statalist@hsphsun2.harvard.edu
Subject   RE: st: RE: RE: RE: RE: RE: RE: RE: global macro for system directory?
Date   Sun, 10 Jan 2010 00:19:57 +0100

Sounds more like a case for a search and replace operation in your favorite text editor than a Stata problem.
HTH
Martin

-original message-
Subject: st: RE: RE: RE: RE: RE: RE: RE: global macro for system directory?
From: David Wallace <dwal2010@yahoo.com.sg>
Date: 09-01-2010 23:59


I have a similar issue with migrating Stata to a new laptop and running my .do file.  Can I change my hardcoded file paths in all my old .do files by specifying a macro that can reroute the filepaths used in a .do file?  So if my .do file says   " use "C:\Documents and Settings\DW\My Documents\thesis.dta", clear " can I specify an macro that will reroute all the "C:\Documents and Settings\DW\My Documents" part in .do files to something like "C:\Documents and Settings\administrator\Documents\"  ????





-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Hoffman, George
Sent: Samstag, 9. Januar 2010 05:33
To: statalist@hsphsun2.harvard.edu
Subject: st: global macro for system directory?

I recently reinstalled stata 10 on my computer with a new os (windows 7). On
my old computer, I had installed in "c:\program files\stata". On the new
computer, it was in "c:\program files\stata10" by default. I had previously
written a bunch of ado and do files for data and log file manipulation that
referenced hardcoded directories under "c:\ptogram files\stata".

I know that the sysdir command will reveal the STATA directory to be the
install directory. Is there a way to retrieve that into a macro or tempvar
that I can then reference from a do or ado file?

Yes, it would all work fine if I just renamed my stata install dir - but I'd
rather not hardcode if possible.

Thanks,
George Hoffman



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



      Get your new Email address!
Grab the Email name you&#39;ve always wanted before someone else does!
http://mail.promotions.yahoo.com/newdomains/sg/


*
*   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–2022 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index