Chapter
10
I
BASIC
Keywords
ENVIRON$
Advanced
Function
ENVIRON$
[('>parameter
id")]
[(number>l
Returns the specified environment string from BASIC's Environ-
ment String Table.
Parameter
id
specifies the parameter for which
to
search. ENVI-
RON$ returns the text string for
parameter
id.
If
the parameter
does not exist or does not contain a text string, ENVIRON$ re-
turns an empty string.
Parameter
id
must be enclosed in quota-
tion marks. If you omit
parameter
id,
you must specify
number.
Number
specifies which parameter
to
return by its position
within the table. ENVIRON$ returns the text string
for
the
number
parameter. If there
is
not a parameter in that position,
ENVIRON$ returns an empty string. If you omit
number,
you
must specify
parameter
id.
Parameter
id
and
number
are mutually exclusive, only one may
be specified on the command line.
For
more information on the Environment String Tables, see the
Programmer's Reference
manual
for
your computer. It is available
at your Radio Shack Computer Store.
Example
If you execute the following ENVIRON statements:
ENVIRON
"PATH=A:
\I'
ENVI
RON
"SALES=MYSALES"
the Environment String Table looks like this:
PATH=A:\;SALES=MYSALES
The command PRINT ENVIRON$("PATH") prints
A:
\
.
The command PRINT ENVIRON$(B) prints SALES
=
MYSALES.
149