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:

  • EnviroVariable$ String literal or variable containing the name of a system environment variable.

 Return Value:

  • RetStr$, the return value, is a string containing the value of the environment variable named by EnviroVariable$. If an EnviroVariable$ parameter argument is not given then a null string is returned.

Example:


 DIM RetStr$

 RetStr$ = ENVIRON$("COMPUTERNAME")
 
 PRINT RetStr$