From Xojo Documentation

Revision as of 19:06, 4 March 2010 by SteffX (talk) (SMBot: new page by automated transformation)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
You are currently browsing the old Xojo documentation site. Please visit the new Xojo documentation site!

System.EnvironmentVariable(Name as String) As String

New in 5.5

Supported for all project types and targets.

Used to get and set environment variables. Name is case-sensitive.

For example, System.EnvironmentVariable("HOME") gets the value of the HOME environment variable, the path to the user's home directory.

The statement System.EnvironmentVariable("HOME")="/Users/username"

sets the path to the Home directory.

To get the list of environment variables and their values (Mac OS X and Linux), execute the "env" command from a terminal window or via the Shell class. On Windows, use the "set" command instead of "env". See the Examples section for an example of listing the environment variables.