qbasic.hlp (Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
ENVIRON$ Function, ENVIRON Statement
  Contents  Index  Back
──────────────────────────────────────────────────────────────────────────────
ENVIRON$ returns a DOS environment string.
ENVIRON changes or adds an environment string in the DOS environment table.
 
ENVIRON$ (env-variable$)
ENVIRON$ (n%)
ENVIRON stringexpression$
 
    ■ 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")