GetEnv
string GetEnv(string name)Description
Reads and returns the value of the specified environment variable.
If the variable does not exist, an empty string is returned and an info message is logged.
Parameter
- name - The name of the environment variable to read.
Returns
The value of the environment variable as a string, or an empty string if not found.
Example
void main()
{
string path = GetEnv("PATH"); // Read the PATH variable
string temp = GetEnv("TEMP"); // Read the TEMP directory
string missing = GetEnv("MY_VAR"); // Returns "" if MY_VAR is not set
}