Thanks for the help that worked
Tom Hart
 

     On Sunday, June 7, 2015 11:26 AM, Albert Berry <[email protected]> 
wrote:
   

   Karen nailed the problem. You must immediately capture the error variable 
before you make any other code, because the code changes the error variable 
back to 0 - no error on the IF line, because that line had no error. 
 
 Albert
 
 On 6/7/2015 10:10 AM, Karen Tellef wrote:
  
Tom:  I have code almost identical to yours that I use and it works.  The only 
difference
 is that I trap the error variable first before testing.  I cannot imagine that 
it should make a
 difference, but it would be an easy thing to try.  I also use the "full" 
parameter.
 
 Code below, feel free to use any of it.
 
 Karen
 
 SET ERROR VAR xError
 
 OUTPUT Autochk.TXT WITH SCREEN
 AUTOCHK RKTPRDE FULL
 SET VAR fvChkErr = .xError
 OUTPUT SCREEN
 
 CLS
 IF fvChkErr > 40 THEN
   DIALOG 'AUTOCHK has found ERRORS in your database!  Reloading the database+
  will fix the errors, but you may lose some data.  DO YOU WANT TO CONTINUE+
  WITH THE RELOAD?'=75 vresp vendkey NO +
     CAPTION 'Autochk File saved AUTOCHK.TXT' ICON serious +
     OPTION MESSAGE_FONT_SIZE 14 +
     | MESSAGE_FONT_BOLD ON | BACK_COLOR WHITE | MESSAGE_COLOR WHITE +
     | MESSAGE_FONT_COLOR RED
 
   IF vresp = 'NO' THEN
     GOTO ENDPROG
   ENDIF
 ENDIF
 
 IF fvChkErr > 0 AND fvChkErr <= 50 THEN
   PAUSE 3 USING ' '
 
   DIALOG 'For some reason, the AUTOCHK program could not run, so I do not know+
  if your database is okay or not.  You should call your database administrator+
  to find the problem.  DO YOU WANT TO CONTINUE WITH THE RELOAD?'=75 vresp 
vendkey NO +
     CAPTION 'Autochk not run' ICON serious +
     OPTION MESSAGE_FONT_SIZE 14 +
     | MESSAGE_FONT_BOLD ON | BACK_COLOR WHITE | MESSAGE_COLOR WHITE +
     | MESSAGE_FONT_COLOR RED
 
   IF vresp = 'NO' THEN
     GOTO ENDPROG
   ENDIF
 ENDIF
 
 IF fvChkErr = 0 THEN
   DIALOG 'Database passed the integrity check!  Do you want to RELOAD?' +
     vresp vendkey NO CAPTION .fvCaption ICON question OPTION MESSAGE_FONT_SIZE 
11
   IF vresp = 'NO' THEN
     CLOSEWINDOW
     RETURN
   ENDIF
 
 ENDIF
 
 
 
   
   
   
  -----Original Message-----
 From: Buddy Walker <[email protected]>
 To: RBASE-L Mailing List <[email protected]>
 Sent: Sun, Jun 7, 2015 11:02 am
 Subject: [RBASE-L] - RE: Autochk
 
  #yiv2132027533 
#yiv2132027533AOLMsgPart_2_fb9bdcbb-0725-4a76-88ad-529859dd0456 
td{color:black;} _filtered #yiv2132027533 {font-family:Helvetica;panose-1:2 11 
6 4 2 2 2 2 2 4;} _filtered #yiv2132027533 {font-family:Helvetica;panose-1:2 11 
6 4 2 2 2 2 2 4;} _filtered #yiv2132027533 {font-family:Calibri;panose-1:2 15 5 
2 2 2 4 3 2 4;} _filtered #yiv2132027533 {font-family:Tahoma;panose-1:2 11 6 4 
3 5 4 4 2 4;}#yiv2132027533 .yiv2132027533aolReplacedBody 
p.yiv2132027533MsoNormal, #yiv2132027533 .yiv2132027533aolReplacedBody 
li.yiv2132027533MsoNormal, #yiv2132027533 .yiv2132027533aolReplacedBody 
div.yiv2132027533MsoNormal 
{margin:0in;margin-bottom:.0001pt;font-size:12.0pt;font-family:"Times New 
Roman", "serif";}#yiv2132027533 .yiv2132027533aolReplacedBody a:link, 
#yiv2132027533 .yiv2132027533aolReplacedBody span.yiv2132027533MsoHyperlink 
{color:blue;text-decoration:underline;}#yiv2132027533 
.yiv2132027533aolReplacedBody a:visited, #yiv2132027533 
.yiv2132027533aolReplacedBody span.yiv2132027533MsoHyperlinkFollowed 
{color:purple;text-decoration:underline;}#yiv2132027533 
.yiv2132027533aolReplacedBody span.yiv2132027533EmailStyle17 
{font-family:"Calibri", "sans-serif";color:#1F497D;}#yiv2132027533 
.yiv2132027533aolReplacedBody .yiv2132027533MsoChpDefault {font-size:10. 0pt;} 
_filtered #yiv2132027533 {margin:1.0in 1.0in 1.0in 1.0in;}#yiv2132027533 
.yiv2132027533aolReplacedBody div.yiv2132027533WordSection1 {}   Tom   What not 
put the output to a file  and then look in the file errors.     The way I would 
do is (make sure you put the word “full” after database name   R:>out 
mydatabaseerr.asc  R:>autochk databasename  full R:>out term R:>RBE 
mydatabaseerr.asc   Buddy       From: [email protected] 
[mailto:[email protected]] On Behalf Of TOM HART
 Sent: Sunday, June 07, 2015 11:44 AM
 To: RBASE-L Mailing List
 Subject: [RBASE-L] - Autochk       I have been having trouble with errors in a 
database so I set up the routine from help:       SET ERROR VAR E1
 WRITE 'Checking database for errors...'
 AUTOCHK database
 IF E1 > 40 THEN
 WRITE 'AUTOCHK has found errors in the database!'
 BEEP
 ENDIF
 If E1 > 0 and E1 < 50 THEN
 WRITE 'AUTOCHK will not run - User Abort or Out of Memory'
 BEEP
 ENDIF
 IF E1 = 0 THEN
 WRITE 'AUTOCHK successful - No errors found'
 ENDIF
 PAUSE 2
 RETURN       When I run this I get no errors, E1 returns 0, but if I run 
'autochk database' from the R> I get errors and E1 is some big number like 
1249.  Any suggestions.    My ultimate goal is the send me an email saying 
there is a problem, I have got that all setup to work, but since my above 
routine does not show errors it does not send       Tom Hart            
 
 -- 
A democracy ..." can only exist until the majority discovers it can vote itself 
largess out of the public treasury."
Attributed to Alexander Fraser Tytler 1747-1813 

  

Reply via email to