OS_Environ
<< Click to Display Table of Contents >> Navigation: ThinBASIC Modules > OS (Operating System) > OS_Environ |
Description
Retrieve information from the operating system's master environment table.
Syntax
s = OS_ENVIRON(EnvironVariableName | EnvironVariableNumber)
Returns
String.
Parameters
OS_Environ has only one parameter but it can be a string or a number.
In case of string, it is assumed it is the name of the environment variable. In this case OS_Environ will return the value of the variable.
In case of number, it is assumed it is the position of the variable in the environment table. In this case OS_Environ will return the value of the variable in "position" environment table.
Name |
Type |
Optional |
Meaning |
EnvironVariableName |
String |
No |
|
EnvironVariableNumber |
Numeric |
No |
Remarks
Restrictions
See also
Examples
DIM sItem AS STRING
DIM lCounter AS LONG
'---Retrieve the "PATH" environment variable
sItem = OS_ENVIRON("PATH")
'---Enumerate all Environment strings
DO
INCR lCounter
sItem = OS_ENVIRON(lCounter)
'---[process sItem here]
LOOP WHILE sItem <> ""