fork(1) download
  1. With Ada.Text_IO; Use Ada.Text_IO;
  2. With Ada.Integer_Text_IO; Use Ada.Integer_Text_IO;
  3. With Ada.Exceptions; Use Ada.Exceptions;
  4.  
  5. procedure Program is
  6. EExceptonA, EExceptonB, EExceptonC, EExceptonD: exception;
  7. begin
  8. -- 任意の処理
  9. begin
  10. raise EExceptonA with "Excepton Message"; -- ここを EExceptonB / C / D とかに変えてみてね
  11. exception
  12. when EExceptonA | EExceptonB =>
  13. Put_Line("Excepton A or B");
  14. when EExceptonC =>
  15. Put_Line("Excepton C");
  16. when E: others =>
  17. Put_Line(Exception_Message(E));
  18. raise;
  19. end;
  20. end Program;
Success #stdin #stdout 0.01s 5456KB
stdin
Standard input is empty
stdout
Excepton A or B