Skip to content
Snippets Groups Projects
Commit c85ff756 authored by Jan Frederik Engels's avatar Jan Frederik Engels :new_moon:
Browse files

Nuke it from Orbit, it's the only way to be sure.

parent 520bb6da
No related branches found
No related tags found
No related merge requests found
MODULE mo_example
USE error_handling
IMPLICIT NONE
CONTAINS
......@@ -90,26 +89,5 @@ PROGRAM example
! interval assignment with milliseconds
td = t_timedelta(360000)
WRITE (0,*) "interval assignment with milliseconds: ", td%to_string()
! ------------------------------------------------------------
! EXAMPLE FOR ERROR HANDLING
! ------------------------------------------------------------
WRITE (0,*) "EXAMPLE FOR ERROR HANDLING"
test_number1 = 10
test_number2 = -1
test_result = division(test_number1, test_number2, ifail)
SELECT TYPE(info => ifail%info)
TYPE is (t_arithmetic_error)
WRITE (0,*) "I'm too stupid!"
CALL ifail%report()
TYPE is (t_invalid_input_error)
WRITE (0,*) "You are too stupid!"
CALL ifail%report()
CLASS default
WRITE (0,*) "Everything was ok!"
WRITE (0,*) "result = ", test_result
END SELECT
END PROGRAM example
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment