home *** CD-ROM | disk | FTP | other *** search
- ********************** ' MultiNet Source Code ' ***********************
- ** ' SBT Corporation ' **
- ** ' One Harbor Drive, Sausalito, California 94965 ' **
- ** ' Telephone (415) 331-9900 ' **
- ***********************************************************************
- ** ' (c) Copyright 1984, Revisions 1985 - 1990 SBT Corporation ' **
- ** ' All Rights Reserved by SBT Corporation ' **
- ** ' ' **
- ***********************************************************************
- ** ' 06/04/90 = Last Update ** SYSFLAG.PRG ** Version 6.35.00 ' **
- ***********************************************************************
- *
- * ' Module: Versions
- * ' ----------------------------- ----------------
- * ' Accounts Payable MultiNet 5.30, 6.10, 6.20, 6.21, 6.30
- * ' Accounts Receivable MultiNet 5.30, 6.10, 6.20, 6.30
- * ' Fixed Assets MultiNet 6.20
- * ' Time Billing MultiNet 6.10, 6.20
- * ' General Ledger MultiNet 6.10, 6.15, 6.20, 6.30
- * ' Manufacturing MultiNet 6.10, 6.15
- * ' Maintenance MultiNet 6.10
- * ' Job Cost MultiNet 6.10, 6.20
- * ' Purchase Orders MultiNet 5.30, 6.10, 6.20, 6.30
- * ' Sales Orders MultiNet 5.30, 6.10, 6.20, 6.30
- * ' Payroll MultiNet 6.15, 6.30
- * ' Property MultiNet 6.20
- *
- * ' Clears all multi-user flags in SYSDATA file and signature fields
- * ' in master files (where 99 = under maintenance), and deletes any
- * ' temporary files (0*.DBF and 0*.NDX) on current and data directory.
- *
- SET TALK OFF
- RELEASE clipper,xquicks,fox,mcmax
- PUBLIC clipper,xquicks,fox,mcmax
- SET BELL OFF
- SET SAFETY OFF
- SET ESCAPE OFF
- SET EXCLUSIVE OFF
- SET DELIMITER OFF
- SET DEVICE TO SCREEN
- SET PRINT OFF
- SET CONSOLE ON
- CLOSE DATABASES
- IF ISCOLOR()
- SET COLOR TO W+/B,N/W,B
- STORE 'C' TO m0monitor
- ELSE
- SET COLOR TO W+/N,N/W,N
- STORE 'M' TO m0monitor
- ENDIF
- CLEAR
- STORE '' TO mtempdr
- STORE ' ' TO mans
- IF .NOT. FILE('sysdata.dbf')
- ?? CHR(7)
- @ 2,4 SAY 'Warning [9002] - SYSDATA.DBF Missing.'
- @ 4,4 SAY 'Informational only - No data has been lost.'
- @ 6,4 SAY 'The SYSDATA.DBF System Data File is not in the current drive and'
- @ 7,4 SAY 'directory. Make sure this file is present and try again'
- @ 10,4 SAY 'SYSFLAG Cancelled. Press any key to continue...' GET mans
- READ
- SET TALK ON
- SET SAFETY ON
- RETURN
- ENDIF
- STORE 'SYSFLAG for MultiNet' TO mtitle
- STORE ' SBT' TO msyflv
- USE sysdata
- LOCATE FOR UPPER(sysid) = 'MM '
- IF EOF()
- ?? CHR(7)
- @ 2,4 SAY 'Warning [9001] - SYSDATA Files/Record Missing.'
- @ 4,4 SAY 'Informational only - No data has been lost.'
- @ 6,4 SAY 'The SYSDATA.DBF is not properly installed. Please run one of'
- @ 7,4 SAY 'the SBT Installation programs and try again.'
- @ 9,4 SAY 'SYSFLAG Cancelled. Press any key to continue...' GET mans
- READ
- SET TALK ON
- SET SAFETY ON
- RETURN
- ENDIF
- STORE SUBSTR(link,2,1) TO mos
- STORE str2 + SUBSTR(str3,1,35) TO m0border
- STORE DATE() TO m0date
- IF CTOD(SUBSTR(a->str8,1,8)) > m0date
- STORE CTOD(SUBSTR(a->str8,1,8)) TO m0date
- ENDIF
- IF SUBSTR(link,2,1) <> 'D'
- STORE SUBSTR(link,1,1) TO m0switchar
- ELSE
- STORE '\' TO m0switchar
- STORE TRIM(LTRIM(SUBSTR(str5,2,25))) TO m0color
- IF SUBSTR(str5,1,1) $ 'CM'
- SET COLOR TO &m0color
- STORE SUBSTR(str5,1,1) TO m0monitor
- ELSE
- * ' If monitor type not defined
- SET COLOR TO W+/N,N/W,N
- @ 22,10 SAY 'What type of Monitor do you have ? (Color/Mono) ' + ;
- SUBSTR(m0border,181,5) GET m0monitor PICTURE '!'
- READ SAVE
- DO WHILE .NOT. m0monitor $ 'CM'
- ?? CHR(7)
- READ SAVE
- ENDDO
- CLEAR GETS
- DO CASE
- CASE m0monitor = 'C' .AND. LEN(m0color) > 0
- SET COLOR TO &m0color
- CASE m0monitor = 'C'
- SET COLOR TO W+/B,N/W,B
- OTHERWISE
- SET COLOR TO W+/N,N/W,N
- ENDCASE
- ENDIF && SUBSTR(str5,1,1) $ 'CM'
- ENDIF && SUBSTR(link,2,1) <> 'D'
- USE
- CLEAR
- @ 1,1 SAY DTOC(m0date)
- @ 1,40 - INT(LEN(mtitle)/2) SAY mtitle
- @ 1,73 SAY msyflv
- @ 2,1 SAY SUBSTR(m0border,10,78)
- STORE ' ***** DANGER! - READ WARNING BELOW BEFORE CONTINUING ***** ' TO msg
- @ 4,4 GET msg
- CLEAR GETS
- @ 6,4 SAY 'This program clears the flags from the SYSDATA.DBF file which'
- @ 7,4 SAY 'keep track of how many people are currently using the system'
- @ 8,4 SAY 'and whether system maintenance is being performed. '
- @ 10,4 SAY 'Maintenance flags can also be cleared from other files in'
- @ 11,4 SAY 'your system which are identified in SYSDATA.DBF and contain'
- @ 12,4 SAY 'the SIGNATURE field.'
- @ 14,4 SAY "Physically check other users' workstations to be sure that"
- @ 15,4 SAY 'you are the only person who is logged in.'
- @ 17,4 SAY 'Failure to do this may jeopardize the integrity of your data.'
- @ 19,4 SAY '*** DO NOT RUN THIS PROGRAM IF OTHER USERS ARE LOGGED IN ***'
- STORE ' ' TO mans
- SET CONFIRM ON
- ?? CHR(7)
- @ 22,4 SAY "Enter 'Y' and <Enter> to continue or " + ;
- "any other key to abort " + SUBSTR(m0border,182,5) GET mans PICTURE '!'
- READ
- SET CONFIRM OFF
- IF mans <> 'Y'
- @ 22,0
- @ 22,4 SAY '***** SYSFLAG Cancelled *****'
- SET TALK ON
- SET SAFETY ON
- SET ESCAPE ON
- RETURN
- ENDIF
- IF .NOT. (clipper .OR. xquicks .OR. fox .OR. mcmax)
- CLEAR
- @ 1,1 SAY DTOC(m0date)
- @ 1,40 - INT(LEN(mtitle)/2) SAY mtitle
- @ 1,73 SAY msyflv
- @ 2,1 SAY SUBSTR(m0border,10,78)
- @ 4,4 SAY ' ***** DANGER! - CHECK LISTING OF USERS BELOW BEFORE ' + ;
- 'CONTINUING ***** '
- @ 5,4 SAY ' '
- DISPLAY USERS
- STORE ' ' TO mans
- SET CONFIRM ON
- @ 22,4 SAY "Enter 'Y' and <Enter> to continue or " + ;
- "any other key to abort " + SUBSTR(m0border,182,5) GET mans PICTURE '!'
- READ
- SET CONFIRM OFF
- IF mans <> 'Y'
- @ 22,0
- @ 22,4 SAY '***** SYSFLAG Cancelled *****'
- SET TALK ON
- SET SAFETY ON
- SET ESCAPE ON
- RETURN
- ENDIF
- ENDIF && clipper .OR. xquicks .OR. fox .OR. mcmax
- CLEAR
- @ 1,1 SAY DTOC(m0date)
- @ 1,40 - INT(LEN(mtitle)/2) SAY mtitle
- @ 1,73 SAY msyflv
- @ 2,1 SAY SUBSTR(m0border,10,78)
- STORE 6 TO mline
- *
- * ' Customization Note: If you set mlimit to 'Y' and define mcomp to equal
- * ' a specific company number, you can create a custom SYSFLAG program which
- * ' will just clear flags from files within that company. This can be useful
- * ' for circumstances when flags other than system wide flags are left on, and
- * ' you wish to clear them without requiring all users be off the system.
- *
- * ' If you use this feature, the program will not clear system wide user count
- * ' flags.
- *
- STORE 'N' TO mlimit
- USE sysdata
- @ 22,0
- @ 22,4 SAY '***** Checking SYSDATA file for Installed Modules *****'
- STORE '' TO mfiles
- STORE 'N' TO mq530, mqap, mqar, mqas, mqdb, mqgl, mqjc, mqma, mqmn, ;
- mqpo, mqpr, mqso, mqpm
- STORE 'Y' TO mqsys
- IF mlimit = 'N'
- * ' check for installed 5.30 modules
- LOCATE FOR SUBSTR(sysid,1,2) $ 'AP.PO.SO' .AND. SUBSTR(sysid,3,2) = SPACE(2)
- IF .NOT. EOF()
- STORE 'Y' TO mq530
- ENDIF
- ENDIF
- * ' check for installed 6.10/6.15/6.20/6.21/6.30 modules
- LOCATE FOR SUBSTR(sysid,1,2) = 'AP' .AND. SUBSTR(sysid,3,2) <> SPACE(2) ;
- .AND. SUBSTR(pass2,1,1) <> 'D'
- IF .NOT. EOF()
- STORE 'Y' TO mqap
- ENDIF
- LOCATE FOR SUBSTR(sysid,1,2) = 'AR' .AND. SUBSTR(sysid,3,2) <> SPACE(2) ;
- .AND. SUBSTR(pass2,1,1) <> 'D'
- IF .NOT. EOF()
- STORE 'Y' TO mqar
- ENDIF
- LOCATE FOR SUBSTR(sysid,1,2) = 'AS' .AND. SUBSTR(sysid,3,2) <> SPACE(2) ;
- .AND. SUBSTR(pass2,1,1) <> 'D'
- IF .NOT. EOF()
- STORE 'Y' TO mqas
- ENDIF
- LOCATE FOR SUBSTR(sysid,1,2) = 'DB' .AND. SUBSTR(sysid,3,2) <> SPACE(2) ;
- .AND. SUBSTR(pass2,1,1) <> 'D'
- IF .NOT. EOF()
- STORE 'Y' TO mqdb
- ENDIF
- LOCATE FOR SUBSTR(sysid,1,2) = 'GL' .AND. SUBSTR(sysid,3,2) <> SPACE(2) ;
- .AND. SUBSTR(pass2,1,1) <> 'D'
- IF .NOT. EOF()
- STORE 'Y' TO mqgl
- ENDIF
- LOCATE FOR SUBSTR(sysid,1,2) = 'JC' .AND. SUBSTR(sysid,3,2) <> SPACE(2) ;
- .AND. SUBSTR(pass2,1,1) <> 'D'
- IF .NOT. EOF()
- STORE 'Y' TO mqjc
- ENDIF
- LOCATE FOR SUBSTR(sysid,1,2) = 'MA' .AND. SUBSTR(sysid,3,2) <> SPACE(2) ;
- .AND. SUBSTR(pass2,1,1) <> 'D'
- IF .NOT. EOF()
- STORE 'Y' TO mqma
- ENDIF
- LOCATE FOR SUBSTR(sysid,1,2) = 'MN' .AND. SUBSTR(sysid,3,2) <> SPACE(2) ;
- .AND. SUBSTR(pass2,1,1) <> 'D'
- IF .NOT. EOF()
- STORE 'Y' TO mqmn
- ENDIF
- LOCATE FOR SUBSTR(sysid,1,2) = 'PO' .AND. SUBSTR(sysid,3,2) <> SPACE(2) ;
- .AND. SUBSTR(pass2,1,1) <> 'D'
- IF .NOT. EOF()
- STORE 'Y' TO mqpo
- ENDIF
- LOCATE FOR SUBSTR(sysid,1,2) = 'PR' .AND. SUBSTR(sysid,3,2) <> SPACE(2) ;
- .AND. SUBSTR(pass2,1,1) <> 'D'
- IF .NOT. EOF()
- STORE 'Y' TO mqpr
- ENDIF
- LOCATE FOR SUBSTR(sysid,1,2) = 'SO' .AND. SUBSTR(sysid,3,2) <> SPACE(2) ;
- .AND. SUBSTR(pass2,1,1) <> 'D'
- IF .NOT. EOF()
- STORE 'Y' TO mqso
- ENDIF
- LOCATE FOR SUBSTR(sysid,1,2) = 'PM' .AND. SUBSTR(sysid,3,2) <> SPACE(2) ;
- .AND. SUBSTR(pass2,1,1) <> 'D'
- IF .NOT. EOF()
- STORE 'Y' TO mqpm
- ENDIF
- USE
- * ' display selection screen and ask for modules to clear
- CLEAR
- @ 1,1 SAY DTOC(m0date)
- @ 1,40 - INT(LEN(mtitle)/2) SAY mtitle
- @ 1,73 SAY msyflv
- @ 2,1 SAY SUBSTR(m0border,10,78)
- @ 4,12 SAY 'Select Files to clear flags from:'
- STORE 6 TO mline
- * ' ask for SYSDATA.DBF
- STORE 'Y' TO mans
- @ mline,12 SAY 'System Master file - SYSDATA.DBF ?'
- @ mline,53 SAY '(Y/N) '+ SUBSTR(m0border,180,7) GET mqsys PICTURE 'Y'
- STORE mline + 1 TO mline
- IF mq530 = 'Y'
- STORE 'N' TO mq530
- * ' Ask for 5.30 if present
- @ mline,12 SAY 'AP/PO/SO Version 5.30 Files ?'
- @ mline,60 SAY SUBSTR(m0border,180,7) GET mqap PICTURE 'Y'
- STORE mline + 1 TO mline
- ENDIF
- IF mqap = 'Y'
- STORE 'N' TO mqap
- @ mline,12 SAY 'Accounts Payable Series Six Files ?'
- @ mline,60 SAY SUBSTR(m0border,180,7) GET mqap PICTURE 'Y'
- STORE mline + 1 TO mline
- ENDIF
- IF mqar = 'Y'
- STORE 'N' TO mqar
- @ mline,12 SAY 'Accounts Receivable Series Six Files ?'
- @ mline,60 SAY SUBSTR(m0border,180,7) GET mqar PICTURE 'Y'
- STORE mline + 1 TO mline
- ENDIF
- IF mqas = 'Y'
- STORE 'N' TO mqas
- @ mline,12 SAY 'Fixed Assets Series Six Files ?'
- @ mline,60 SAY SUBSTR(m0border,180,7) GET mqas PICTURE 'Y'
- STORE mline + 1 TO mline
- ENDIF
- IF mqdb = 'Y'
- STORE 'N' TO mqdb
- @ mline,12 SAY 'Time Billing Series Six Files ?'
- @ mline,60 SAY SUBSTR(m0border,180,7) GET mqdb PICTURE 'Y'
- STORE mline + 1 TO mline
- ENDIF
- IF mqgl = 'Y'
- STORE 'N' TO mqgl
- @ mline,12 SAY 'General Ledger Series Six Files ?'
- @ mline,60 SAY SUBSTR(m0border,180,7) GET mqgl PICTURE 'Y'
- STORE mline + 1 TO mline
- ENDIF
- IF mqjc = 'Y'
- STORE 'N' TO mqjc
- @ mline,12 SAY 'Job Cost Series Six Files ?'
- @ mline,60 SAY SUBSTR(m0border,180,7) GET mqjc PICTURE 'Y'
- STORE mline + 1 TO mline
- ENDIF
- IF mqma = 'Y'
- STORE 'N' TO mqma
- @ mline,12 SAY 'Manufacturing Series Six Files ?'
- @ mline,60 SAY SUBSTR(m0border,180,7) GET mqma PICTURE 'Y'
- STORE mline + 1 TO mline
- ENDIF
- IF mqmn = 'Y'
- STORE 'N' TO mqmn
- @ mline,12 SAY 'Maintenance Series Six Files ?'
- @ mline,60 SAY SUBSTR(m0border,180,7) GET mqmn PICTURE 'Y'
- STORE mline + 1 TO mline
- ENDIF
- IF mqpo = 'Y'
- STORE 'N' TO mqpo
- @ mline,12 SAY 'Purchase Orders Series Six Files ?'
- @ mline,60 SAY SUBSTR(m0border,180,7) GET mqpo PICTURE 'Y'
- STORE mline + 1 TO mline
- ENDIF
- IF mqpr = 'Y'
- STORE 'N' TO mqpr
- @ mline,12 SAY 'Payroll Series Six Files ?'
- @ mline,60 SAY SUBSTR(m0border,180,7) GET mqpr PICTURE 'Y'
- STORE mline + 1 TO mline
- ENDIF
- IF mqso = 'Y'
- STORE 'N' TO mqso
- @ mline,12 SAY 'Sales Orders Series Six Files ?'
- @ mline,60 SAY SUBSTR(m0border,180,7) GET mqso PICTURE 'Y'
- STORE mline + 1 TO mline
- ENDIF
- IF mqpm = 'Y'
- STORE 'N' TO mqpm
- @ mline,12 SAY 'Property Series Six Files ?'
- @ mline,60 SAY SUBSTR(m0border,180,7) GET mqpm PICTURE 'Y'
- STORE mline + 1 TO mline
- ENDIF
- READ
- CLEAR GETS
- * ' setup file name string with files to process
- IF mqap = 'Y'
- STORE mfiles + 'APMAST.' TO mfiles
- ENDIF
- IF mqar = 'Y'
- STORE mfiles + 'ARMAST.' TO mfiles
- ENDIF
- IF mqas = 'Y'
- STORE mfiles + 'ASSETS.' TO mfiles
- ENDIF
- IF mqdb = 'Y'
- STORE mfiles + 'DBTRAN.' TO mfiles
- ENDIF
- IF mqgl = 'Y'
- STORE mfiles + 'GLACNT.' TO mfiles
- ENDIF
- IF mqjc = 'Y'
- STORE mfiles + 'JCMSTR.JCPROJ.' TO mfiles
- ENDIF
- IF mqma = 'Y'
- STORE mfiles + 'MABILL.MATRAN.' TO mfiles
- ENDIF
- IF mqmn = 'Y'
- STORE mfiles + 'MNCONF.MNEQUI.MNMAIN.' TO mfiles
- ENDIF
- IF mqpo = 'Y'
- STORE mfiles + 'POMAST.' TO mfiles
- ENDIF
- IF mqpr = 'Y'
- STORE mfiles + 'PREMPL.PRDEDU.PRPOST.PRXPST.PRMAST.PRTXCD.' TO mfiles
- ENDIF
- IF mqso = 'Y'
- STORE mfiles + 'SOMAST.' TO mfiles
- ENDIF
- IF mqpm = 'Y'
- STORE mfiles + 'PMTRAN.' TO mfiles
- ENDIF
- * ' qive final chance to cancel
- STORE mline + 1 TO mline
- STORE 'Y' TO mans
- @ mline,12 SAY 'Continue with clearing of flags ? (Y/N) ' + ;
- SUBSTR(m0border,182,5) GET mans PICTURE 'Y'
- READ
- IF mans = 'N'
- USE
- @ 22,0
- @ 22,12 SAY '***** SYSFLAG Cancelled *****'
- SET TALK ON
- SET SAFETY ON
- SET ESCAPE ON
- RETURN
- ENDIF
- @ 3,0 CLEAR
- IF mqsys = 'Y'
- * ' clear flags in system file if selected
- USE sysdata
- STORE FLOCK() TO lockedf
- STORE ' ' TO mwait
- DO WHILE .NOT. lockedf .AND. .NOT. mwait $ 'Nn'
- STORE ' ' TO mwait
- ?? CHR(7)
- ?
- WAIT 'File is in use. Press N to quit or any key to retry... ' TO mwait
- STORE FLOCK() TO lockedf
- ENDDO
- IF .NOT. lockedf
- USE
- @ 22,0
- @ 22,12 SAY '***** SYSFLAG Cancelled *****'
- SET TALK ON
- SET SAFETY ON
- SET ESCAPE ON
- RETURN
- ENDIF
- LOCATE FOR sysid = 'MM '
- @ 23,0
- @ 23,3 SAY 'Clearing maintenance flags from SYSDATA.DBF...'
- IF mlimit = 'Y'
- SET FILTER TO SUBSTR(sysid,3,2) = mcomp
- GO TOP
- ELSE
- REPLACE ALL str10 WITH 'NNNNNNNNNN'+SUBSTR(str10,9,2), int2 WITH 0, ;
- int3 WITH 1, num8 WITH 0, num10 WITH 0 FOR UPPER(sysid) = 'MM '
- ENDIF
- REPLACE ALL str10 WITH 'NNNNNNNNNN', num10 WITH 0 FOR ;
- SUBSTR(UPPER(sysid),1,2) $ 'AP|AS|DB|JC|PM' .AND. SUBSTR(sysid,3,2) <> ' '
- REPLACE ALL str10 WITH 'NNNNNNNNNN', num8 WITH 0 FOR ;
- SUBSTR(UPPER(sysid),1,2) = 'MA'
- REPLACE ALL num10 WITH 0, num9 WITH 0, num8 WITH 0, str1 WITH 'N' + ;
- SPACE(149) FOR SUBSTR(UPPER(sysid),1,2) = 'GL' .AND. ;
- SUBSTR(sysid,3,2) <> ' '
- REPLACE ALL int2 WITH 0, int3 WITH 0 FOR SUBSTR(UPPER(sysid),1,2) $ ;
- 'PR.JC' .AND. SUBSTR(sysid,3,2) <> ' ' .AND. VAL(SUBSTR(drive,198,3)) ;
- >= 615
- USE
- ENDIF && mqsys = 'Y'
- IF mq530 = 'Y'
- * ' clear version 5.30 master file flags if selected
- STORE 1 TO mcnt
- DO WHILE .t.
- DO CASE
- CASE mcnt = 1
- STORE 'AP' TO mpgmid
- CASE mcnt = 2
- STORE 'PO' TO mpgmid
- CASE mcnt = 3
- STORE 'SO' TO mpgmid
- OTHERWISE
- EXIT
- ENDCASE
- USE sysdata
- LOCATE FOR sysid = mpgmid + ' '
- IF .NOT. EOF()
- STORE TRIM(SUBSTR(drive,61,30)) TO mdrive
- STORE mdrive + mpgmid + '-MAST' TO mfilef
- IF FILE('&mfilef..dbf')
- ?
- ? 'Clearing maintenance flags from ' + mfilef + '.DBF...'
- SELECT b
- USE &mfilef
- STORE FLOCK() TO lockedf
- STORE ' ' TO mwait
- DO WHILE .NOT. lockedf .AND. .NOT. mwait $ 'Nn'
- STORE ' ' TO mwait
- ?? CHR(7)
- ?
- WAIT 'File is in use. Press N to quit or any key to retry... ' ;
- TO mwait
- STORE FLOCK() TO lockedf
- ENDDO
- IF lockedf
- REPLACE ALL signature WITH 0
- ENDIF
- USE
- SELECT a
- ENDIF && FILE('&mfilef..dbf')
- ENDIF && .NOT. EOF()
- STORE mcnt + 1 TO mcnt
- ENDDO && WHILE .t.
- ENDIF && mq530 = 'Y'
- IF 'Y' $ mqap + mqar + mqas + mqdb + mqgl + mqjc + mqma + mqmn + mqpo + ;
- mqpr + mqso + mqpm
- * ' clear version 6.xx file flags, if any selected
- STORE 1 TO mcnt
- DO WHILE .t.
- DO CASE
- CASE mcnt = 1
- STORE 'APMAST' TO mfilef
- CASE mcnt = 2
- STORE 'ARMAST' TO mfilef
- CASE mcnt = 3
- STORE 'ASSETS' TO mfilef
- CASE mcnt = 4
- STORE 'DBTRAN' TO mfilef
- CASE mcnt = 5
- STORE 'GLACNT' TO mfilef
- CASE mcnt = 6
- STORE 'JCMSTR' TO mfilef
- CASE mcnt = 7
- STORE 'JCPROJ' TO mfilef
- CASE mcnt = 8
- STORE 'MABILL' TO mfilef
- CASE mcnt = 9
- STORE 'MATRAN' TO mfilef
- CASE mcnt = 10
- STORE 'MNCONF' TO mfilef
- CASE mcnt = 11
- STORE 'MNEQUI' TO mfilef
- CASE mcnt = 12
- STORE 'MNMAIN' TO mfilef
- CASE mcnt = 13
- STORE 'POMAST' TO mfilef
- CASE mcnt = 14
- STORE 'PREMPL' TO mfilef
- CASE mcnt = 15
- STORE 'PRDEDU' TO mfilef
- CASE mcnt = 16
- STORE 'PRPOST' TO mfilef
- CASE mcnt = 17
- STORE 'PRHPST' TO mfilef
- CASE mcnt = 18
- STORE 'PRXPST' TO mfilef
- CASE mcnt = 19
- STORE 'PRMAST' TO mfilef
- CASE mcnt = 20
- STORE 'PRTXCD' TO mfilef
- CASE mcnt = 21
- STORE 'SOMAST' TO mfilef
- CASE mcnt = 22
- STORE 'PMTRAN' TO mfilef
- OTHERWISE
- EXIT
- ENDCASE
- IF mfilef + '.' $ mfiles
- SELECT a
- USE sysdata
- * ' find module SYSDATA records
- LOCATE FOR SUBSTR(sysid,1,2) = SUBSTR(mfilef,1,2) .AND. ;
- SUBSTR(sysid,3,4) <> ' ' .AND. SUBSTR(pass2,1,1) <> 'D'
- DO WHILE .NOT. EOF()
- * ' get data drive/directory
- STORE TRIM(SUBSTR(drive,61,30)) + mfilef + SUBSTR(sysid,3,2) ;
- TO mxfilef
- STORE TRIM(SUBSTR(drive,61,30)) TO tempdr
- IF FILE('&mxfilef..dbf')
- * ' if file found, clear flags
- @ 23,0
- @ 23,3 SAY 'Clearing maintenance flags from ' + mxfilef + '.DBF...'
- SELECT b
- USE &mxfilef
- * ' lock file
- STORE FLOCK() TO lockedf
- STORE ' ' TO mwait
- DO WHILE .NOT. lockedf .AND. .NOT. mwait $ 'Nn'
- STORE ' ' TO mwait
- ?? CHR(7)
- ?
- WAIT 'File is in use. Press N to quit or any key to retry... ' ;
- TO mwait
- STORE FLOCK() TO lockedf
- ENDDO
- * ' check to make sure there is a SIGNATURE field before clearing
- RELEASE signature
- IF lockedf .AND. TYPE('signature') = 'N'
- REPLACE ALL signature WITH 0
- ENDIF
- USE
- SELECT a
- ENDIF && FILE('&mxfilef..dbf')
- * ' if DOS or Xenix, delete temporary files in data directory
- IF mtempdr <> tempdr .AND. mos $ 'DX'
- @ 23,0
- @ 23,3 SAY 'Deleting (0*.DBF/NDX) files from Data Directory: ' + ;
- tempdr
- SET CONSOLE OFF
- IF mos = 'D'
- STORE 'IF EXIST ' + tempdr + '0*.DBF DEL ' + tempdr + ;
- '0*.DBF > NUL' TO mdosact
- ELSE
- STORE 'rm -f ' + tempdr + '0*.DBF' TO mdosact
- ENDIF
- RUN &mdosact.
- IF mos = 'D'
- STORE 'IF EXIST ' + tempdr + '0*.NDX DEL ' + tempdr + ;
- '0*.NDX > NUL' TO mdosact
- ELSE
- STORE 'rm -f ' + tempdr + '0*.NDX' TO mdosact
- ENDIF
- RUN &mdosact.
- SET CONSOLE ON
- ENDIF
- STORE tempdr TO mtempdr
- CONTINUE
- ENDDO && WHILE .NOT. EOF()
- USE
- ENDIF && mfilef + '.' $ mfiles
- STORE mcnt + 1 TO mcnt
- ENDDO && WHILE .t.
- ENDIF && 'Y' $ mqap + mqar + mqas + mqdb + mqgl + mqjc + mqma + mqmn etc.
- CLOSE DATABASES
- IF mos $ 'DX'
- * ' if DOS or Xenix, delete any temporary files
- @ 23,0
- @ 23,3 SAY ;
- 'Deleting temporary (0*.DBF and 0*.NDX) files in current directory...'
- SET CONSOLE OFF
- IF mos = 'D'
- RUN IF EXIST 0*.DBF DEL 0*.DBF
- ELSE
- RUN rm -f 0*.dbf
- ENDIF
- IF mos = 'D'
- RUN IF EXIST 0*.NDX DEL 0*.NDX
- ELSE
- RUN rm -f 0*.ndx
- ENDIF
- SET CONSOLE ON
- ENDIF
- @ 22,0 CLEAR
- @ 22,3 SAY 'Clearing of Flags Completed...'
- @ 23,3 SAY '***** SYSFLAG Program Normal End *****'
- SET TALK ON
- SET SAFETY ON
- SET ESCAPE ON
- RETURN
- *
- * ' $Revision: 1.17 $
- * ' $Date: 29 May 1990 17:34:42 $
- **********************
- ** ' SYSFLAG.PRG ' **
- ** ' 654 Lines ' **
- **********************