Difference between revisions of "Os.getenv"

From GiderosMobile
m (Text replacement - "</source>" to "</syntaxhighlight>")
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
'''<translate>Available since</translate>:''' Gideros 2011.6<br/>
+
'''Available since:''' Gideros 2011.6<br/>
=== <translate>Description</translate> ===
+
'''Class:''' [[os]]<br/>
<translate>Returns the value of the process environment variable varname, or nil if the variable is not defined.</translate>
+
 
<source lang="lua">
+
=== Description ===
 +
Returns the value of the process environment variable varname, or nil if the variable is not defined.
 +
<syntaxhighlight lang="lua">
 
(any) = os.getenv(varname)
 
(any) = os.getenv(varname)
</source>
+
</syntaxhighlight>
=== <translate>Parameters</translate> ===
+
 
'''varname''': (string) <translate>name of the variable</translate> <br/>
+
=== Parameters ===
=== <translate>Return values</translate> ===
+
'''varname''': (string) name of the variable<br/>
'''<translate>Returns</translate>''' (any) <translate>value of the variable</translate><br/>
+
 
 +
=== Return values ===
 +
'''Returns''' (any) value of the variable<br/>
 +
 
 +
=== Examples ===
 +
<syntaxhighlight lang="lua">
 +
os.getenv("HOME") -- user folder on Mac & Linux
 +
os.getenv("HOMEPATH") -- user folder on Windows
 +
os.getenv("HOMEDRIVE") -- user drive on Windows
 +
</syntaxhighlight>
 +
 
 +
{{Os}}

Latest revision as of 14:31, 13 July 2023

Available since: Gideros 2011.6
Class: os

Description

Returns the value of the process environment variable varname, or nil if the variable is not defined.

(any) = os.getenv(varname)

Parameters

varname: (string) name of the variable

Return values

Returns (any) value of the variable

Examples

os.getenv("HOME") -- user folder on Mac & Linux
os.getenv("HOMEPATH") -- user folder on Windows
os.getenv("HOMEDRIVE") -- user drive on Windows