Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Re: access to environment vars. in windows

From (Alan Riley)
Subject   st: Re: access to environment vars. in windows
Date   Wed, 16 Apr 2003 07:55:35 -0500

Gregory Branch ( wrote
> The programming manual for V.7 SE lists an extended
> macro function for accessing the values of system
> environment variables by name from stata code. The
> text in the manual indicates that this is available in
> both Windows and Unix.  
> To make a long story short, I have a common routine
> that I need to respond to a machine-specific
> parameter, and it would be vary nice if I could get at
> a the windows environment variables.

System environment variables may be accessed with the -env-
extended macro function.  Here is an example:

   . local x : env PATH

The local macro -x- will now contain whatever Windows has in the
PATH environment variable, and subsequent references in Stata
code to `x' wil be replaced with the contents of PATH.

*   For searches and help try:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index