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");
   IO.Put_Line (Item => EV.Value (Name => "PATH"));
   IO.Put_Line (Item => EV.Value (Name => "NONEXISTENT"));
 
exception
   when Constraint_Error =>
      IO.Put_Line (Item => "No such environment variable.");
end Env;

Go back


Navigation