Handle a signal: Difference between revisions
Content added Content deleted
(Added COBOL) |
m (→{{header|REXX}}: changed/added comments and whitespace, changed indentations, add comments in the REXX section header and output section.) |
||
Line 1,105: | Line 1,105: | ||
=={{header|REXX}}== |
=={{header|REXX}}== |
||
REXX has no |
REXX has no '''sleep''' function that is built into the language. |
||
⚫ | |||
⚫ | |||
⚫ | |||
/* the number of seconds that have elapsed since start of pgm execution.*/ |
|||
⚫ | |||
⚫ | |||
signal on halt /*HALT is signaled via a Ctrl─C.*/ |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
/*────────────────────────────────── seconds that have elapsed since start of execution.*/ |
|||
t=time('E') /*get the elapsed time in seconds*/ |
|||
call time 'Reset' /*reset the REXX elapsed timer. */ |
|||
signal on halt /*HALT: signaled via a Ctrl─C in DOS.*/ |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
say 'Program control should never ever get here, said Captain Dunsel.' |
|||
⚫ | |||
⚫ | |||
do forever; u=time('Elapsed') /* " " " " " " " */ |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
/*──────────────────────────────────HALT subroutine─────────────────────*/ |
|||
⚫ | |||
⚫ | |||
'''output''' |
|||
⚫ | |||
{{out}} |
|||
<pre> |
<pre> |
||
1 |
1 |
||
Line 1,156: | Line 1,153: | ||
</pre> |
</pre> |
||
Note: some REXX interpreters don't show the |
Note: some REXX interpreters don't show the |
||
<b> |
|||
<pre> |
<pre> |
||
^C |
^C |
||
</pre> |
</pre> |
||
</b> |
|||
when <big> Ctrl-C </big> is pressed. |
|||
<br><br> |
|||
=={{header|Ruby}}== |
=={{header|Ruby}}== |