Category : BASIC Source Code
Archive   : QB_CODE.ZIP
Filename : LSRCHSTR.BAS

 
Output of file : LSRCHSTR.BAS contained in archive : QB_CODE.ZIP

'
' LSRCHSTR.BAS - For the QuickBASIC Toolbox
' String Linear Search Function
'

'
' $INCLUDE: 'TOOLBOX.BI'
'

DEFINT A-Z

FUNCTION LSEARCHSTR (ARRAY$(), SKEY$)
LOWER = LBOUND(ARRAY$, 1)
UPPER = UBOUND(ARRAY$, 1)
FOR I = LOWER TO UPPER
IF ARRAY$(I) = SKEY$ THEN
LSEARCHSTR = I
EXIT FUNCTION
END IF
NEXT I
LSEARCHSTR = LOWER - 1
END FUNCTION