Hi all,
I've had as my core error handler in place since Fox 2... It was always fine until VFP came along, and for years I kind of tolerated this, but since I'm "back in the game" and very rusty, I get a lot more errors popping up when I run the app. So finally this has started to annoy me, and I'm hoping someone can help.
Basically what happens is, when an error occurs, my ON ERROR runs a small window in code, so there is no issue with forms and other complexities. BUT, it has a problem. I have 3 buttons (Retry, Cancel, Quit to OS), but as soon as the mouse passes over them, they vanish. I have no idea why this happens. It never happened in DOS, or Mac or Win 3.11 under VFP 2.6, and by the time I was doing early VFP code, it was not a big deal, as I didn't make as many mistakes as I do now.
The code is:
I've left out some of the code that ignores certain errors for brevity, otherwise this would be a long bit of code, but the key "problem" area is there. I am just not sure what I'm doing wrong that causes them to vanish.
Any ideas?
Best Regards,
Scott
ATS, CDCE, CTIA, CTDC
"Everything should be made as simple as possible, and no simpler."
I've had as my core error handler in place since Fox 2... It was always fine until VFP came along, and for years I kind of tolerated this, but since I'm "back in the game" and very rusty, I get a lot more errors popping up when I run the app. So finally this has started to annoy me, and I'm hoping someone can help.
Basically what happens is, when an error occurs, my ON ERROR runs a small window in code, so there is no issue with forms and other complexities. BUT, it has a problem. I have 3 buttons (Retry, Cancel, Quit to OS), but as soon as the mouse passes over them, they vanish. I have no idea why this happens. It never happened in DOS, or Mac or Win 3.11 under VFP 2.6, and by the time I was doing early VFP code, it was not a big deal, as I didn't make as many mistakes as I do now.
The code is:
Code:
ON ERROR DO BADNEWS WITH ERROR(), MESSAGE(), MESSAGE(1),SYS(16), LINENO()
*
SET CONSOLE ON
SET PRINTER OFF
SET DEVICE TO SCREEN
*
CLEAR TYPEAHEAD
*
SET CONSOLE &XCONSOLE
SET PRINTER &XPRINTER
SET DEVICE TO &XDEVICE
*
DO SETONERR
*
DEFINE WINDOW SYSERRWIND;
FROM 8,5 TO 20,125 IN SCREEN;
TITLE 'APPLICATION ERROR INTERRUPT';
FOOTER 'Retry, Cancel, Quit to OS';
DOUBLE FLOAT NOGROW SHADOW;
COLOR SCHEME 7
MOVE WINDOW SYSERRWIND CENTER
ACTIVATE WINDOW SYSERRWIND
*
@ 0,2 SAY 'Error No:'
@ 0,14 SAY M.XERROR PICTURE '#,###'
@ 1,2 SAY 'Error Msg:'
@ 1,14 SAY M.XMSG
@ 2,2 SAY 'Prog Code:'
@ 2,14 SAY LEFT(M.XCODE,120)
@ 3,2 SAY 'Program:'
@ 3,14 SAY M.XMODULE
@ 4,2 SAY 'Line No:'
@ 4,14 SAY M.XLINENO PICTURE '##,###'
@ 5,2 SAY 'Data File:'
@ 5,14 SAY M.XCURDBF
@ 6,2 SAY 'Data Field:'
@ 6,14 SAY M.XGETFIELD
*
DO CASE
CASE RDLEVEL() > 5
DO CASE
CASE _DOS
M.NEWBUTTON = '<R>etry, <C>ancel, or <O>S?'
CASE _WINDOWS
M.NEWBUTTON = '<R>etry, <C>ancel, or <O>S?'
CASE _MAC
M.NEWBUTTON = '<R>etry, <C>ancel, or <O>S?'
ENDCASE
@ 8,10 SAY M.NEWBUTTON COLOR SCHEME glCLRDLG
*
DO WHILE .T.
M.RVALUE = INKEY(0,'HM')
M.BUTTONOPT = UPPER(CHR((M.RVALUE)))
IF M.BUTTONOPT $ 'RFDW'
EXIT
ENDIF
I've left out some of the code that ignores certain errors for brevity, otherwise this would be a long bit of code, but the key "problem" area is there. I am just not sure what I'm doing wrong that causes them to vanish.
Any ideas?
Best Regards,
Scott
ATS, CDCE, CTIA, CTDC
"Everything should be made as simple as possible, and no simpler."