- This is not the released version of the documentation. Recommended Version
- Tags:
- example
- environment
- variable
Example: Environment variables
- Contents
- Description
- Notes
- Solution
- Output
Description
Using features from the class EXECUTION_ENVIRONMENT to create and retrieve an environment variable.
Notes
The make procedure of the class APPLICATION below uses the features put and get, inherited from the class EXECUTION_ENVIRONMENT, to create the environment variable MY_VARIABLE with value "Hello World!", and then to retrieve the value by key and print it.
Solution
class
APPLICATION
inherit
EXECUTION_ENVIRONMENT
create
make
feature {NONE} -- Initialization
make
-- Create and retrieve an environment variable.
do
put ("Hello World!", "MY_VARIABLE")
print (get ("MY_VARIABLE"))
end
end
Output
Hello World!
Back to Examples