10-09-2024, 03:37 AM
The actual code to trap Control-Break I am using is posted here:
Code: (Select All)
Rem ctrl-break sample v1.0a
' disable ctrl-break.
Print "Press Ctrl-Break to test:"
v = _Exit
' jump here to restart trap.
start:
Timer(t1) Off
t1 = _FreeTimer
Print "Timer handle"; t1
On Timer(t1, 1) GoSub trap
Timer(t1) On
' start inkey$ loop.
z = z + 1
Print "Timer start loop"; z
Do
x$ = InKey$
If Len(x$) Then
If x$ = Chr$(27) Then End
End If
Loop
' trap ctrl-break.
trap:
v = _Exit
y = y + 1
Print "Trap call"; y
If v Then
x = x + 1
Print "Break trap"; x
Return start
End If
Return