ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / WLanguage functions / Standard functions / Windows functions / System functions
  • Search
  • Equivalence
  • Environment variables in a WEBDEV site
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
SysEnvironment (Function)
In french: SysEnvironnement
Returns the environment variables of the operating system for the current computer.
Remark: To view and/or modify the current workstation's environment variables, open the Control Panel and click on the "System" icon.
Example
// Connaître toutes les variables d'environnement du système d'exploitation
ResEnvironnement = SysEnvironment()
// Connaître les variables d'environnement du système d'exploitation
Trace(SysEnvironment("homepath"))
// renvoie par exemple: 
// homepath=\Users\doc
Syntax
<Result> = SysEnvironment([<Environment variable>])
<Result>: Character string
  • Full environment of current computer (or server) if no <Environment variable> is specified. The environment lines are separated by CR characters.
  • Environment line whose first word corresponds to the <Environment variable> parameter.
  • Empty string ("") if a problem occurred.
<Environment variable>: Optional character string
Variable to find in the environment of the current computer ("PATH" or "USERNAME" for instance).
Remarks

Search

  • The search on the <Environment variable> parameter is generic. For example, SysEnvironment("PR") returns the line corresponding to the prompt (if it exists in the environment).
  • If several lines match the search, only the first one is returned.

Equivalence

SysEnvironment returns the same result as the SET command of the DOS command line.
WEBDEV - Server code

Environment variables in a WEBDEV site

The environment variables returned correspond to the environment variables of the operating system of the server.
The CGI protocol defines a set of default variables:
Variable nameContent
DOCUMENT_ROOTThe root directory for the documents of the Web server.
HTTP_COOKIEThe value of the cookies saved by the server.
Remark: To handle cookies, it's best to use the CookieRead and CookieWrite functions.
HTTP_HOSTThe server name.
HTTP_REFERERThe URL of the page that directed to the current page.
HTTP_USER_AGENTThe description of the browser used.
HTTPSThis variable will have the value "on" if the HTTPS protocol was used. Otherwise, it is not defined.
QUERY_STRINGThe URL requested by the client machine before interpretation by the server. This is the "raw" request.
REMOTE_ADDRThe IP address of the browser. We recommend that you use BrowserIPAddress.
REMOTE_HOSTThe name of the client computer (or its IP address if the name could not be resolved or if the resolution feature is disabled in the Web server).
REMOTE_PORTThe port used by the client computer to connect to the Web server.
REMOTE_USERThe username provided by the client computer (used for pages protected by a HTTP authentication mechanism).
REQUEST_METHODThe method used to make the HTTP request: "GET" or "POST".
REQUEST_URIThe URI requested by the client computer after interpretation by the server.
SCRIPT_FILENAMEThe full path of the program being run on the web server.
SCRIPT_NAMEThe portion of the SCRIPT_FILENAME variable relative to the DOCUMENT_ROOT variable.
SERVER_ADMINThe contact information of the server administrator (his email address in most cases).
SERVER_NAMEThe host header name of the server.
SERVER_PORTThe port on which the Web server has been contacted.
SERVER_SOFTWAREThe information string of the Web server (if it is provided).
Component: wd300std.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Needs examples
The text implies that the name is returned, but it is more than that.

SysEnvironvmen("HOMEPATH") returns the string "HOMEPATH=\user\user-name"
Bob
20 Jul. 2021

Last update: 09/21/2024

Send a report | Local help