QBasic 1.1: ENVIRON$ Function

Syntax

ENVIRON$ (env-variable$)
ENVIRON$ (n%)
ENVIRON stringexpression$

Description / Parameter(s)

env-variable$ The name of a DOS environment variable.
n% Specifies that ENVIRON$ returns the nth string from the environment string table.
stringexpression$ The name and setting of a DOS environment variable (such as PATH or PROMPT) in one of the following forms:
env-variable$=env-string$
env-variable$ env-string$
Changes made by the ENVIRON statement are erased when the program ends.

Example

ENVIRON "PATH=TEST" PRINT ENVIRON$("PATH")