<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=utf-8">
<META content="MSHTML 6.00.6000.16809" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=621541818-23022009><FONT face=Arial
size=2>Hi</FONT></SPAN></DIV>
<DIV><SPAN class=621541818-23022009><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=621541818-23022009><FONT face=Arial size=2>The thread last week
reminded me of some processing I wrote to trap BREAK. Normally when you hit
Control-C you immediately exit the application. The only way I could find to
trap the Control-C was this:</FONT></SPAN></DIV>
<DIV><SPAN class=621541818-23022009><FONT face=Arial size=2>First, most of my
applications run from a Stand File, if I'm doing Customer Maintence, I copyin
the customer record, make my changes and copy back to customer file. Because of
the method, I also turn SAVE OFF, so I can save my changes to the customer file
and not the file I'm standing on. With BREAK OFF it seems you can't use @sk, but
you can use it for the Escape key wIith SAVE OFF. The only solution was to
set PFSKHEX=ON. Control-C = "0003".</FONT></SPAN></DIV>
<DIV><SPAN class=621541818-23022009><FONT face=Arial size=2>You can test this
input processing by creating a 1 field file, and goto Add
Records.</FONT></SPAN></DIV>
<DIV><SPAN class=621541818-23022009><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=621541818-23022009><FONT face=Arial
size=2>::end:<BR>@wef1::cls("21") ; save off ; break off:<BR>::showctr("22")
"Press \K4 to Save, Press \KY to Exit":<BR>::show (@ro,@co) "":<BR>loop::sk =
waitkey:<BR>:@sk eq "entr":screen ,1:<BR>:@sk eq "save":gosub saveit ;
screen ,1:<BR>:@sk eq "0003":gosub QuitYN:<BR>:Quit eq "Y":delete ; close
; exit:<BR>::screen ,1:<BR>::goto loop:<BR>::end:<BR>QuitYN::msgbox "Quit
?","Y or N","yn":<BR>:@bk eq "y":Quit = "y" ; return:<BR>:@bk ne "n":goto
QuitYN":<BR>::return:<BR>saveit::msgbox "Saving
Data":<BR>::return:<BR>declare::declare Quit</FONT></SPAN><SPAN
class=621541818-23022009><FONT face=Arial size=2>:</FONT></SPAN></DIV>
<DIV><SPAN class=621541818-23022009><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=621541818-23022009><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=621541818-23022009><FONT face=Arial size=2> 1
------- - - - -
- - - - -
- - -
-<BR> ◄
If:<BR> Then: end<BR> 2
------- - - - -
- - - - -
- - - -<BR>@wef1 ◄
If:<BR> Then: cls("21") ; save off ; break
off<BR> 3 ------- - -
- - - - -
- - - - -
-<BR> ◄
If:<BR> Then: showctr("22") "Press \K4 to
Save, Press \KY to Exit"<BR> 4 ------- -
- - - - -
- - - - -
- -<BR> ◄
If:<BR> Then: show (@ro,@co) ""<BR>
5 ------- - - -
- - - - -
- - - - -<BR>loop ◄
If:<BR> Then: sk = waitkey<BR> 6
------- - - - -
- - - - -
- - -
-<BR> ◄ If: @sk eq
"entr"<BR> Then: screen
,1</FONT></SPAN></DIV>
<DIV><SPAN class=621541818-23022009><FONT face=Arial size=2> 7
------- - - - -
- - - - -
- - - - -
- -<BR> ◄ If: @sk eq
"save"<BR> Then: gosub saveit ; screen
,1<BR> 8 ------- - -
- - - - -
- - - - -
- - -
-<BR> ◄ If: @sk eq
"0003"<BR> Then: gosub QuitYN<BR>
9 ------- - - -
- - - - -
- - - - -
- - -<BR> ◄ If: Quit
eq "Y"<BR> Then: delete ; close ;
exit<BR> 10 ------- - -
- - - - -
- - - - -
- - -
-<BR> ◄
If:<BR> Then: screen
,1<BR> 11 ------- - -
- - - - -
- - - - -
- - -
-<BR> ◄
If:<BR> Then: goto loop<BR> 12
------- - - - -
- - - - -
- - - - -
- -<BR> ◄
If:<BR> Then: end</FONT></SPAN></DIV>
<DIV><SPAN class=621541818-23022009><FONT face=Arial size=2> 13
------- - - - -
- - - - -
- - - - -
- -<BR>QuitYN ◄
If: <BR>
Then: msgbox "Quit ?","Y or
N","yn" </FONT></SPAN></DIV>
<DIV><SPAN class=621541818-23022009><FONT face=Arial size=2> 14
------- - - - -
- - - - -
- - - - -
- -<BR> ◄ If: @bk eq
"y" </FONT></SPAN></DIV>
<DIV><SPAN class=621541818-23022009><FONT face=Arial
size=2> Then: Quit = "y" ;
return <BR> 15
------- - - - -
- - - - -
- - - - -
- -<BR> ◄ If: @bk ne
"n" <BR>
Then: goto
QuitYN" <BR> 16
------- - - - -
- - - - -
- - - - -
- -<BR> ◄
If: <BR>
Then:
return </FONT></SPAN></DIV>
<DIV><SPAN class=621541818-23022009><FONT face=Arial size=2> 17
------- - - - -
- - - - -
- - - - -
- -<BR>saveit ◄
If: <BR>
Then: msgbox "Saving Data" ;
return <BR> 18
------- - - - -
- - - - -
- - - - -
- -<BR>declare◄
If: <BR>
Then: declare
Quit </FONT></SPAN></DIV>
<DIV><SPAN class=621541818-23022009><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=621541818-23022009><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=621541818-23022009><FONT face=Arial size=2>Bob
Simcoe</FONT></SPAN></DIV>
<DIV><SPAN class=621541818-23022009><FONT face=Arial
size=2></FONT></SPAN> </DIV></BODY></HTML>