home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 13
/
CD_ASCQ_13_0494.iso
/
maj
/
419
/
extract.bas
< prev
next >
Wrap
BASIC Source File
|
1994-03-13
|
1KB
|
30 lines
' +----------------------------------------------------------------------+
' | |
' | PBClone Copyright (c) 1990-1994 Thomas G. Hanlin III |
' | |
' +----------------------------------------------------------------------+
SUB Extract (St$, Delimiter$, Index%, Start%, SLen%)
Ind% = Index%
IF LEN(Delimiter$) > 0 AND Index% > 0 THEN
Start% = 1
DO
tmp% = INSTR(Start%, St$, Delimiter$)
Ind% = Ind% - 1
IF Ind% = 0 THEN
IF tmp% THEN
SLen% = tmp% - Start%
ELSE
SLen% = LEN(St$) - Start% + 1
END IF
ELSEIF tmp% = 0 THEN
SLen% = 0
ELSE
Start% = tmp% + LEN(Delimiter$)
END IF
LOOP UNTIL tmp% = 0 OR Ind% = 0
ELSE
SLen% = -1
END IF
END SUB