ENVIRON$

Format

string1 = ENVIRON$(number1)

Description

This statement will retrieve DOS environment strings. Number1 identifies which string to retrieve. If found, the string is placed in string1. If not found, a NULL string (length=0) is stored in string1.

Example

FOR I=1 TO 5
A$=ENVIRON$(I)
PRINT A$
NEXT I
The above example will retrieve the first five DOS environment strings and display them.

Comments

If the requested DOS environment string entry is greater than 80 characters in length, ASIC will truncate it at 80 characters. Environment strings may be set in DOS using the SET command. Environment strings are one way of passing information to your program. Refer to your MS DOS Manual for more information. Common uses of this command are to retrieve the user's PATH statement, or the COMSPEC variable.