The following global variables are created and managed automatically by the Tcl library. Except where noted below, these variables should normally be treated as read-only by application-specific code and by users.
Under Windows, the environment variables PATH and COMSPEC in any capitalization are converted automatically to upper case. For instance, the PATH variable could be exported by the operating system as “path” “Path” “PaTh” etc., causing otherwise simple Tcl code to have to support many special cases. All other environment variables inherited by Tcl are left unmodified. Setting an env array variable to blank is the same as unsetting it as this is the behavior of the underlying Windows OS. It should be noted that relying on an existing and empty environment variable will not work on Windows and is discouraged for cross-platform usage.
The following elements of env are special to Tcl:
Note that this environment variable should not normally be set.
Detection of these errors depends in part on the underlying hardware and system libraries.
To set the -errorcode return option, applications should use library procedures such as Tcl_SetObjErrorCode, Tcl_SetReturnOptions, and Tcl_PosixError, or they may invoke the -errorcode option of the return command. If none of these methods for setting the error code has been used, the Tcl interpreter will reset the variable to NONE after the next error.
The wish executable additionally specifies the following global variable: