Difference between revisions of "Os.getenv"

From GiderosMobile
m (Text replacement - "<source" to "<syntaxhighlight")
Line 5: Line 5:
 
=== Description ===
 
=== Description ===
 
Returns the value of the process environment variable varname, or nil if the variable is not defined.
 
Returns the value of the process environment variable varname, or nil if the variable is not defined.
<source lang="lua">
+
<syntaxhighlight lang="lua">
 
(any) = os.getenv(varname)
 
(any) = os.getenv(varname)
 
</source>
 
</source>
Line 16: Line 16:
  
 
=== Examples ===
 
=== Examples ===
<source lang="lua">
+
<syntaxhighlight lang="lua">
 
os.getenv("HOME") -- user folder on Mac & Linux
 
os.getenv("HOME") -- user folder on Mac & Linux
 
os.getenv("HOMEPATH") -- user folder on Windows
 
os.getenv("HOMEPATH") -- user folder on Windows

Revision as of 14:30, 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. <syntaxhighlight lang="lua"> (any) = os.getenv(varname) </source>

Parameters

varname: (string) name of the variable

Return values

Returns (any) value of the variable

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 </source>