home *** CD-ROM | disk | FTP | other *** search
/ The Fred Fish Collection 1.5 / ffcollection-1-5-1992-11.iso / ff_progs / prog_oth / m2amiga.lzh / M2AMIGA / DEMOS / SIGNALS.MOD < prev    next >
Encoding:
Text File  |  1991-08-16  |  693 b   |  31 lines

  1. MODULE signals;
  2. (* 2.0 / 1.5.87 / ms *)
  3. (* Copyright 1987 by Markus Schaub/AMSoft
  4.  * Permission granted to do anything with this program as long as nobody
  5.  * gets hurt directly. Don't throw it out of the window! :-)
  6.  *)
  7. FROM SYSTEM IMPORT
  8.  LONGSET;
  9. FROM Exec IMPORT
  10.  Wait;
  11. FROM Terminal IMPORT
  12.  WriteString,WriteLn;
  13. VAR
  14.  sig: LONGSET;
  15. BEGIN
  16.  LOOP
  17.   sig:=Wait(LONGSET{12..15});
  18.   (* Ctrl-C is detected by Arts the run-time system (interrupt driven)
  19.    * Use it to stop the program!
  20.    *)
  21.   IF    13 IN sig THEN
  22.    WriteString("Ctrl-D detected")
  23.   ELSIF 14 IN sig THEN
  24.    WriteString("Ctrl-E detected")
  25.   ELSIF 15 IN sig THEN
  26.    WriteString("Ctrl-F detected")
  27.   END;
  28.   WriteLn
  29.  END
  30. END signals.
  31.