home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
World of Shareware - Software Farm 2
/
wosw_2.zip
/
wosw_2
/
QBAS
/
PBCLON20.ZIP
/
PBC$BAS.ZIP
/
EXTRACT.BAS
< prev
next >
Wrap
BASIC Source File
|
1992-10-07
|
1KB
|
30 lines
' +----------------------------------------------------------------------+
' | |
' | PBClone Copyright (c) 1990-1992 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