ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Standard functions / Windows functions / System functions
  • Search
  • Equivalence
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
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 environment variables of the current computer, open the control panel and click the "System" icon.
Example
// Get all the environment variables of the operating system
ResEnvironment = SysEnvironment()
// Get the environment variables of the operating system
Trace(SysEnvironment("homepath"))
// returns for example:
// 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.
Component: wd290std.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: 05/26/2022

Send a report | Local help