Handle a signal: Difference between revisions
Content added Content deleted
Simple9371 (talk | contribs) (Omit Batch file) |
No edit summary |
||
Line 1,435: | Line 1,435: | ||
<lang bash>TRAPINT(){ print $n; exit } |
<lang bash>TRAPINT(){ print $n; exit } |
||
for (( n = 0; ; n++)) sleep 1</lang> |
for (( n = 0; ; n++)) sleep 1</lang> |
||
=={{header|Visual FoxPro}}== |
|||
<lang vfp> |
|||
*!* In VFP, Ctrl+C is normally used to copy text to the clipboard. |
|||
*!* Esc is used to stop execution. |
|||
CLEAR |
|||
SET ESCAPE ON |
|||
ON ESCAPE DO StopLoop |
|||
CLEAR DLLS |
|||
DECLARE Sleep IN WIN32API INTEGER nMilliSeconds |
|||
lLoop = .T. |
|||
n = 0 |
|||
? "Press Esc to Cancel..." |
|||
t1 = INT(SECONDS()) |
|||
DO WHILE lLoop |
|||
n = n + 1 |
|||
? n |
|||
Sleep(500) |
|||
ENDDO |
|||
? "Elapsed time:", TRANSFORM(INT(SECONDS()) - t1) + " secs." |
|||
CLEAR DLLS |
|||
RETURN TO MASTER |
|||
PROCEDURE StopLoop |
|||
lLoop = .F. |
|||
ENDPROC |
|||
</lang> |
|||
=={{header|zkl}}== |
=={{header|zkl}}== |