<type>documentation</type>
<domain>proj</domain>
<id>variable-expansion</id>
<title>Environment Variable Expansion</title>
<date>$Date: 2009-06-22 17:37:40 -0400 (Mon, 22 Jun 2009) $</date>
<version>$Revision: 20510 $</version>
<product>per+</product>

Any string value for a property may contain environment variable references using the
``$(name)`` or ``$ {name}`` notation. These will be replaced with the value of the
environment variable when used by the IDE. If the environment variable is not set, the
reference will be replaced by an empty string. 

The system environment, as modified by Wing's `Project Properties
<ref:proj/project-properties>`__ and `File Properties
<ref:proj/file-properties>`__, is used to expand variable references.

**Special Environment Variables**

The following special variable names are defined by Wing:

* ``WING:FILENAME`` -- Full path of currently selected file, either in the editor,
  in the ``Project`` tool or in other places where files can be selected.
* ``WING:FILENAME_DIR`` -- Full path of the directory containing the currently selected file
* ``WING:LINENO`` -- Current line number in the currently selected file
* ``WING:SCOPE`` -- Dotted name of the current scope in the currently selected file (if Python)
* ``WING:PROJECT`` Full path of current project, including the ``*.wpr`` project file name
* ``WING:PROJECT_DIR`` -- Full path of the directory containing the current project's ``*.wpr``
* ``WING:PROJECT_HOME`` -- Full path of the ``Project Home`` directory, as set in 
  ``Project Properties``; by default this is the same as ``WING:PROJECT_DIR``
* ``WING:SELECTION`` -- The text selected on the current editor, if any
~~~if WINGPRO:
* ``WING:HOSTNAME`` -- (Wing Pro only) The remote configuration's ``Hostname`` 
   for the current project, or the empty string if not a remote project
~~~
* ``WING:PYTHON`` -- The Python interpreter being used in the current project

These can be use the same way as other environment variables, for example
``${WING:FILENAME}``. Values based on the currently selected file or selection will
evaluate to an empty string when there is none.
