OS-GETENV function
- Last Updated: April 28, 2022
- 1 minute read
- OpenEdge
- Version 12.2
- Documentation
Returns a string that contains the value of the desired environment variable in the environment in which the ABL session is running.
Syntax
|
- environment-variable
- The name of the environment variable whose value you want to find.
Example
This procedure prompts a user for a report name. It then builds the full pathname where the report will be stored, using OS-GETENV to find the DLC directory. Finally, the procedure displays the full pathname.
r-os-env.p
|
Notes
- If
the environment variable is not defined, this statement returns the Unknown value (
?). - This function returns the value of an environment variable defined before the ABL session started, not a variable defined during the session.
- Since environment variables are case sensitive in some environments, make sure that the name you supply is the correct case.
- For security reasons some operating systems may not return certain system environment
variable values. In these cases the Unknown value (
?) is returned. - When the AVM retrieves an environment variable from the operating system, it assumes
that the value is encoded using the same encoding as the internal code page setting
(
-cpinternal). No conversion is done when reading the value into the AVM's memory. The application may need to use theCODEPAGE-CONVERTfunction to convert the value from the operating system encoding to the session encoding if it is not already in a compatible format.