From 8ecfc3295164a8cc4b791a3e38f914b7129883e4 Mon Sep 17 00:00:00 2001 From: eiffel-org Date: Mon, 30 Apr 2018 00:00:13 +0000 Subject: [PATCH] Update wikipage Managing CTRL+C on console. (Signed-off-by:tioui). git-svn-id: https://svn.eiffel.com/eiffel-org/trunk@1991 abb3cda0-5349-4a8f-a601-0c33ac3a8c38 --- .../Managing-CTRL-C-on-console.wiki | 25 ++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/documentation/18.01/eiffel/Tutorials/Mini-HowTo/Managing-CTRL-C-on-console.wiki b/documentation/18.01/eiffel/Tutorials/Mini-HowTo/Managing-CTRL-C-on-console.wiki index f8e811a8..3aab37e1 100644 --- a/documentation/18.01/eiffel/Tutorials/Mini-HowTo/Managing-CTRL-C-on-console.wiki +++ b/documentation/18.01/eiffel/Tutorials/Mini-HowTo/Managing-CTRL-C-on-console.wiki @@ -5,18 +5,35 @@ Normally, if the user use the CTRL+C keys, the Eiffel application detect it as an error and throw an exception of type {OPERATING_SYSTEM_SIGNAL_FAILURE}. To manage the CTRL+C keys, you can use a rescue clause to detect the exception and a retry mecanism to cancel the exception handeling done by the Eiffel runtime. +note + description: "Show hot to quit an application using CTRL+C (without trace)." + autheur: "Louis Marchand" + date: "Wed, 25 Apr 2018 23:12:33 +0000" + revision: "0.1" + +class + APPLICATION + +inherit + EXCEPTIONS + +create make - -- Running `Current'. + +feature {NONE} -- Initialisation + + make + -- Exécute l'application. local l_ctrl_c:BOOLEAN do if not l_ctrl_c then from until False loop - io.standard_default.put_string ("Press CTRL+C%N") + io.standard_default.put_string ("Appuyez sur CTRL+C%N") io.input.read_line end else - io.standard_default.put_string ("%NClosing...%N") + io.standard_default.put_string ("%NFermeture...%N") end rescue if attached {OPERATING_SYSTEM_SIGNAL_FAILURE} Exception_manager.last_exception then @@ -24,4 +41,6 @@ Normally, if the user use the CTRL+C keys, the Eiffel application detect it as a retry end end + +end \ No newline at end of file