422
ENV( ) Function
Get Environment Values
Formats
Where:
env-id
Numeric value of the environment variable to be returned.
env_name$ Character string containing the environment variable to be returned.
stmtref
Program line number or label to transfer control to.
Returns
Value of an environment variable
Description
Use the ENV( ) function to obtain the value of an environment variable (specified
numerically or in a string) from the externally defined environment table.
Environment variables are typically external to ProvideX and are used by the
operating system and other utilities for defining the user's environment.
Format 1: Using Numeric ID
ENV(env_id[,ERR=stmtref])
If env_id exceeds the size of the Environment Table, ProvideX returns Error #41:
Invalid integer encountered (range error or non-integer).
Otherwise, ENV( ) returns the current value of the given environment variable.
The following program displays all the environment variables:
0010 LET I=1
0020 LET X$=ENV(I,ERR=0050)
0030 PRINT X$
0040 LET I=I+1; GOTO 0020
0050 STOP
-:run
TEMP=C:\WINDOWS\TEMP
PROMPT=$p$g
winbootdir=C:\WINDOWS
COMSPEC=C:\WINDOWS\COMMAND.COM
CLASSPATH=.;c:\COREL\OFFICE7\SHARED\BARISTA;c:\COREL\OFFICE7\SHARED\TRUEDOC
LD_LIBRARY_PATH=c:\COREL\OFFICE7\SHARED\TRUEDOC\BIN
PATH=C:\WINDOWS;C:\WINDOWS\COMMAND;C:\COREL\OFFICE7\SHARED\TRUEDOC
\BIN;C:\SOFTWARE\WP60;C:\OTHER\BAT;C:\SOFTWARE\WINSIM\CA_APPSW
CMDLINE=WIN
windir=C:\WINDOWS
BLASTER=A220 I5 D1 H5 P330 T6