Razzak posted a macro for reloading a database.  I am using it with my own
modifications.  I call it REORG.MAC

   *( reorg.mac )
SET ERROR VAR E1
cls
WRITE "Checking database for errors..."   at 8 21
disc
AUTOCHK  mdpc
IF E1 > 40 THEN
  cls
  WRITE "AUTOCHK has found errors in the database!"    at 10 21
  BEEP
  pause 2 using "Call Programmer"
  goto aldun
ENDIF
If E1 > 0 and E1 < 50 THEN
  cls
  WRITE "AUTOCHK will not run - User Abort or Out of Memory"  at 10 21
  BEEP
  pause 2
  goto aldun
ENDIF
IF E1 = 0 THEN
  WRITE "'AUTOCHK successful - No errors found"   at 10 21
--  pause 2 using "Press [Enter] to continue to reload the database"
ENDIF
del old.rb?
con mdpc
set var vDBsize double = (istat("dbsize"))
set var vSpace double =  (istat("diskspace"))
set var isitok = (.vSpace - (.vDBsize * 2))
if vSpace > .isitok  then
  disc
  ren mdpc.rb1 old.rb1
  ren mdpc.rb2 old.rb2
  ren mdpc.rb3 old.rb3
  ren mdpc.rb4 old.rb4
  con old
  reload mdpc
  disc
  con mdpc
else
  pause 2 using "Not Enough disk space to reorg database"
endif
Label aldun
clear var e1, vDBsize, vSpace, isitok
return


Bernie Lis
Megabytes, Inc.

================================================
TO SEE MESSAGE POSTING GUIDELINES:
Send a plain text email to [EMAIL PROTECTED]
In the message body, put just two words: INTRO rbase-l
================================================
TO UNSUBSCRIBE: send a plain text email to [EMAIL PROTECTED]
In the message body, put just two words: UNSUBSCRIBE rbase-l
================================================
TO SEARCH ARCHIVES:
http://www.mail-archive.com/rbase-l%40sonetmail.com/

Reply via email to