home *** CD-ROM | disk | FTP | other *** search
- ********************
-
- FUNCTION Modi_con
-
- PARAMETERS _p1, _p2, _p3
-
- * _p1 is the minimum FILES size in the config.sys
- * _p2 is the minimum BUFFER size for the CONFIG.SYS
- * _p3 is the DRIVE where CONFIG.SYS is located
-
- IF PCOUNT() = 2
- _p3 = _p2
- _p2 = "8"
- ENDIF
-
- _p1 = IF(TYPE("_p1") = "N", STR(_p1), _p1)
- _p2 = IF(TYPE("_p2") = "N", STR(_p2), _p2)
-
- PRIVATE _a1, _fa1, _b1, _ma1, _ea1, _fm1
-
- _a1 = TRIM(UPPER(MEMOREAD(_p3+ "\CONFIG.SYS"))) && The string
-
- IF !("FILE" $ UPPER(_a1)) .AND. !("BUFFER" $ UPPER(_a1)) && Neither the file statement nor the buffer statement is there
- _a1 = _a1 + CHR(13) + CHR(10)
- _a1 = _a1 + "FILES = " + _p1 + CHR(13) + CHR(10)
- _a1 = _a1 + "BUFFERS = " + _p2
- _a1 = STRTRAN(_a1, CHR(13)+CHR(10)+CHR(13)+CHR(10), CHR(13)+CHR(10) )
- MEMOWRIT(_p3+"\CONFIG.SYS", _a1)
-
- ELSE
-
- MEMOWRIT(_p3+"\CONFIG.SST", _a1)
- _fa1 = SUBSTR(_a1, 1, AT("FILE", _a1)-1) && The front of the string
- _b1 = SUBSTR(_a1, AT("FILE", _a1)) && The middle & end of string
- _ma1 = SUBSTR(_b1, 1, AT(CHR(10), _b1) - 1) && The middle of the string
- _ea1 = SUBSTR(_b1, AT(CHR(10), _b1)) && The end of the string
- _fm1 = LTRIM(TRIM(SUBSTR(_ma1, AT("=", _ma1)+1)))
- _ma1 = STRTRAN(_ma1, _fm1, _p1)
- _ea1 = STRTRAN(_ea1, CHR(27))
- _a1 = LTRIM(TRIM(_fa1 + _ma1 + CHR(13) + _ea1))
- MEMOWRIT(_p3+"\CONFIG.SYS", _a1)
-
- IF PCOUNT() = 3
- _a1 = TRIM(UPPER(MEMOREAD(_p3+ "\CONFIG.SYS"))) && The string
- _fa1 = SUBSTR(_a1, 1, AT("BUFFERS", _a1)-1) && The front of the string
- _b1 = SUBSTR(_a1, AT("BUFFERS", _a1)) && The middle & end of string
- _ma1 = SUBSTR(_b1, 1, AT(CHR(10), _b1) - 1) && The middle of the string
- _ea1 = SUBSTR(_b1, AT(CHR(10), _b1)) && The end of the string
- _fm1 = LTRIM(TRIM(SUBSTR(_ma1, AT("=", _ma1)+1)))
- _ma1 = STRTRAN(_ma1, _fm1, _p2)
- _ea1 = STRTRAN(_ea1, CHR(27))
- _a1 = LTRIM(TRIM(_fa1 + _ma1 + CHR(13) + _ea1))
- MEMOWRIT(_p3+"\CONFIG.SYS", _a1)
- ENDIF
-
- ENDIF
-
- RETURN( DOSERROR() = 0 )
-
- * End of File