home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a075 / 1.img / TOOLKIT1.EXE / SST234.PRG < prev    next >
Encoding:
Text File  |  1989-08-08  |  2.2 KB  |  61 lines

  1. ********************
  2.  
  3. FUNCTION Modi_con
  4.  
  5.    PARAMETERS _p1, _p2, _p3
  6.  
  7.    * _p1 is the minimum FILES size in the config.sys
  8.    * _p2 is the minimum BUFFER size for the CONFIG.SYS
  9.    * _p3 is the DRIVE where CONFIG.SYS is located
  10.  
  11.    IF PCOUNT() = 2
  12.       _p3 = _p2
  13.       _p2 = "8"
  14.    ENDIF
  15.  
  16.    _p1 = IF(TYPE("_p1") = "N", STR(_p1), _p1)
  17.    _p2 = IF(TYPE("_p2") = "N", STR(_p2), _p2)
  18.  
  19.    PRIVATE _a1, _fa1, _b1, _ma1, _ea1, _fm1 
  20.  
  21.    _a1 = TRIM(UPPER(MEMOREAD(_p3+ "\CONFIG.SYS")))     && The string
  22.  
  23.    IF !("FILE" $ UPPER(_a1)) .AND. !("BUFFER" $ UPPER(_a1))   && Neither the file statement nor the buffer statement is there
  24.       _a1 = _a1 + CHR(13) + CHR(10)
  25.       _a1 = _a1 + "FILES = " + _p1 + CHR(13) + CHR(10)
  26.       _a1 = _a1 + "BUFFERS = " + _p2
  27.       _a1 = STRTRAN(_a1, CHR(13)+CHR(10)+CHR(13)+CHR(10), CHR(13)+CHR(10) )
  28.       MEMOWRIT(_p3+"\CONFIG.SYS", _a1)
  29.  
  30.    ELSE
  31.  
  32.       MEMOWRIT(_p3+"\CONFIG.SST", _a1)
  33.       _fa1 = SUBSTR(_a1, 1, AT("FILE", _a1)-1)            && The front of the string
  34.       _b1 = SUBSTR(_a1, AT("FILE", _a1))                  && The middle & end of string
  35.       _ma1 = SUBSTR(_b1, 1, AT(CHR(10), _b1) - 1)         && The middle of the string
  36.       _ea1 = SUBSTR(_b1, AT(CHR(10), _b1))                && The end of the string
  37.       _fm1 = LTRIM(TRIM(SUBSTR(_ma1, AT("=", _ma1)+1)))
  38.       _ma1 = STRTRAN(_ma1, _fm1, _p1)
  39.       _ea1 = STRTRAN(_ea1, CHR(27))
  40.       _a1 = LTRIM(TRIM(_fa1 + _ma1 + CHR(13) + _ea1))
  41.       MEMOWRIT(_p3+"\CONFIG.SYS", _a1)
  42.    
  43.       IF PCOUNT() = 3
  44.          _a1 = TRIM(UPPER(MEMOREAD(_p3+ "\CONFIG.SYS")))  && The string
  45.          _fa1 = SUBSTR(_a1, 1, AT("BUFFERS", _a1)-1)      && The front of the string
  46.          _b1 = SUBSTR(_a1, AT("BUFFERS", _a1))            && The middle & end of string
  47.          _ma1 = SUBSTR(_b1, 1, AT(CHR(10), _b1) - 1)      && The middle of the string
  48.          _ea1 = SUBSTR(_b1, AT(CHR(10), _b1))             && The end of the string
  49.          _fm1 = LTRIM(TRIM(SUBSTR(_ma1, AT("=", _ma1)+1)))
  50.          _ma1 = STRTRAN(_ma1, _fm1, _p2)
  51.          _ea1 = STRTRAN(_ea1, CHR(27))
  52.          _a1 = LTRIM(TRIM(_fa1 + _ma1 + CHR(13) + _ea1))
  53.          MEMOWRIT(_p3+"\CONFIG.SYS", _a1)
  54.       ENDIF
  55.  
  56.    ENDIF
  57.  
  58.    RETURN( DOSERROR() = 0 )
  59.  
  60. * End of File
  61.