MBS Xojo Developer Conference and Training
Join us from 3rd to 6th May 2017 in Berlin, Germany.

Platforms to show: All Mac Windows Linux Cross-Platform

FAQ.How to catch Control-C on Mac or Linux in a console app?
Feedback.

Answer: You can use SignalHandlerMBS class for this.
Example:
// watch for Control-C on Mac
call SignalHandlerMBS.SetFlagHandler(2)

dim ende as boolean = false
do
if SignalHandlerMBS.IsFlagSet(2) then
Print "Flag 2 set. Existing..."
ende = true
end if

DoEvents 1
loop until ende
Notes: The signal is catched, a flag is set and you can ask later in your normal application flow for the result.




Links
Bilder aus Nickenich