with Ada.Text_IO;
with Ada.Environment_Variables;
 
procedure Env is
   package IO renames Ada.Text_IO;
   package EV renames Ada.Environment_Variables;
begin
   IO.Put_Line (Item => "Environment_Variables test");   
   if not EV.Exists (Name => "NONEXISTANT") then
      IO.Put_Line (Item => "DOES NOT EXIST!");
   end if;
   EV.Set (Name  => "NONEXISTANT",
           Value => "FooBar");
   IO.Put_Line (Item => EV.Value (Name => "NONEXISTENT"));
   EV.Set (Name  => "NONEXISTANT",
           Value => "FooBar again");
   IO.Put_Line (Item => EV.Value (Name => "NONEXISTENT"));
end Env;

Go back


Navigation