In the first case, the argument to the function is a numeric expression. The string returned is the "name=value" entry selected by using the value of the expression as an index into the environment variable list. If the value of the expression is too large the null string is returned.
In the second case, the argument to the function is a string expression. The string returned is the value associated with the environment variable whose name matched the name given by the string expression.
i = 1 while environ$(i) <> "" print environ$(i) i = i + 1 wendThe output might look like this:
HOME=/usr/ljl PATH=:/bin:/usr/bin SHELL=/bin/sh TERM=tvi950 TZ=EST5EDTThe following program will print the user’s path:
print environ$("PATH")The output might look like this:
:/bin:/usr/bin
from The Basmark QuickBASIC Programmer’s Manual by Lawrence Leinweber