ENVIRON$ function

Purpose: Retrieve information from the environment table of the operating system.

Note well that the maximum size for an ENVIRON$ variable is 32767 and that there is the danger of string buffer overrun if a stock 2048 byte string is used to dimension the RetStr$ used to retrieve a larger value from an environment variable. A string should be dynamically sized if a string variable is to receive a large value.

System environment variables commonly are used in CGI programming.


 Syntax:

 RetStr$ = ENVIRON$(EnviroVariable$)

 Parameters:

  • RetStr$ Returned string containing value of EnviroVariable$. If parameter string is not found, or no text follows the equal sign, then a null string is returned.
  • EnviroVariable$ String literal or variable containing the name of a system environment variable.

Example:


 A$ = ENVIRON$("HTTP_REFERER")

Remarks: If parameter string is not found, or no text follows the equal sign, then a null string is returned.