Environ, Environ$ (functions)

Syntax Environ[$]( variable$ | VariableNumber)
Description Returns the value of the specified environment variable.
Comments Environ$ returns a String , whereas Environ returns a String variant. If variable$ is specified, then this function looks for that variable$ in the environment. If the variable$ name cannot be found, then a zero-length string is returned. If VariableNumber is specified, then this function looks for the Nth variable within the environment (the first variable being number 1). If there is no such environment variable, then a zero-length string is returned. Otherwise, the entire entry from the environment is returned in the following format:
 variable = value
Example This example looks for the DOS Comspec variable and displays the value in a dialog box.
Sub Main()
 Dim a$(1)
 a$(1) = Environ("SITE_Root")
 MsgBox "My CIMPLICITY project directory is: " & a$(1)
End Sub
See Also Command, Command$ (functions).