home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a070 / 3.ddi / FOXPRO / SAMPLE / CONFIGCK.PRG next >
Encoding:
Text File  |  1990-04-07  |  2.5 KB  |  76 lines

  1. * ┌─────────────────────────────────────────────────────────────────────┐ *
  2. * │  PROG NAME: CONFIGCK.PRG. Check user's CONFIG.SYS file.             │ *
  3. * │  Copyright (c) 1989 Tech III, Inc. All rights reserved.             │ *
  4. * │  Tech III of San Pedro, California      (213) 547-2191.             │ *
  5. * │  "The bridge connecting people and technology."(tm)                 │ *
  6. * └─────────────────────────────────────────────────────────────────────┘ *
  7.  
  8. PUBLIC mdrive
  9. DO msg2user WITH 'Checking FILES setting in your CONFIG.SYS file...'
  10. STORE '' TO mdrive
  11. USE system
  12. LOCATE FOR LABEL = 'DRIVE'
  13. IF RECCOUNT() = 0
  14.   APPEND BLANK
  15. ENDIF
  16. IF .NOT. EMPTY(contents)
  17.   STORE contents + ':'  TO mdrive
  18. ELSE
  19.   STORE 'C:' TO mdrive
  20. ENDIF
  21. STORE .t. TO checking
  22. DO WHILE checking
  23.   DO WHILE checking .AND. .NOT. FILE(mdrive + '\CONFIG.SYS')
  24.     STORE ' ' TO mdrive
  25.     ACTIVATE WINDOW msg2user
  26.     CLEAR
  27.     @ 00,01 SAY "Can't find your system CONFIG.SYS file."
  28.     @ 01,01 SAY "Enter drive letter (or blanks to bypass this safety check)."
  29.     @ 02,01 SAY "Location of CONFIG.SYS is drive: " GET mdrive PICTURE '!'
  30.     READ
  31.     IF EMPTY(mdrive)
  32.       STORE .f. TO checking
  33.       LOOP
  34.     ENDIF
  35.     STORE LTRIM(mdrive + ':') TO mdrive
  36.     IF FILE(mdrive + '\CONFIG.SYS')
  37.       REPLACE NEXT 1 contents WITH LEFT(mdrive,1)
  38.     ENDIF
  39.   ENDDO no FILE
  40.   IF .NOT. checking
  41.     LOOP
  42.   ENDIF
  43.   config = FOPEN(mdrive + '\CONFIG.SYS')
  44.   STORE -1 TO fileset
  45.   STORE .t. TO looking
  46.   DO WHILE looking .AND. .NOT. FEOF(config)
  47.     inputline = FGETS(config)
  48.     IF  'FILES' $ UPPER(inputline)
  49.       STORE VAL(LTRIM(SUBSTR(inputline,AT('=',inputline)+1))) TO fileset
  50.     ENDIF
  51.     IF fileset # -1
  52.       STORE .f. TO looking
  53.     ENDIF
  54.   ENDDO
  55.   = FCLOSE(config)
  56.   IF fileset < 50
  57.     DO msg2user WITH 'CONFIG.SYS PROBLEM: Your FILES setting is not high enough.',;
  58.     'A minimum of 50 is suggested.  Check the documentation ',;
  59.     'before continuing.  CURRENT SETTING: ' + LTRIM(STR(fileset,4))
  60.     IF .NOT. YESNO('Proceed cautiously until you resolve this message.')
  61.       QUIT
  62.     ENDIF
  63.   ENDIF fileset < 50
  64.   STORE .f. TO checking
  65. ENDDO checking
  66. USE
  67. IF VAL(LTRIM(SYS(12))) < 70000
  68.   DO msg2user WITH 'MEMORY PROBLEM: ONLY ' + LTRIM(SYS(12)) + ' AVAILABLE!',;
  69.   'Not enough to run this program: PROCEED AT YOUR OWN RISK!', ;
  70.   'Data may be lost if you do not quit now.'
  71.   IF .NOT. YESNO('A NO answer cancels this program safely now, YES will proceed at risk.')
  72.     QUIT
  73.   ENDIF
  74. ENDIF
  75. RETURN
  76.