home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 13
/
CD_ASCQ_13_0494.iso
/
maj
/
419
/
replacst.bas
< prev
next >
Wrap
BASIC Source File
|
1994-03-13
|
878b
|
25 lines
' +----------------------------------------------------------------------+
' | |
' | PBClone Copyright (c) 1990-1994 Thomas G. Hanlin III |
' | |
' +----------------------------------------------------------------------+
SUB ReplaceString (St$, Old$, New$, Found%, ErrCode%)
Found% = 0
IF LEN(Old$) THEN
ErrCode% = 0
IF Old$ <> New$ THEN
tmp% = INSTR(St$, Old$)
IF tmp% THEN
DO
St$ = LEFT$(St$, tmp% - 1) + New$ + MID$(St$, tmp% + LEN(Old$))
tmp% = INSTR(tmp% + LEN(New$), St$, Old$)
LOOP WHILE tmp%
Found% = -1
END IF
END IF
ELSE
ErrCode% = -1
END IF
END SUB