@SMcNeill
So something along the lines of this using indexing. Interesting...
Pete
So something along the lines of this using indexing. Interesting...
Code: (Select All)
search$ = "moose"
a$ = "Dog Cat Rabbit Moose Elephant Bear Tiger Fish "
' Create the indexing for this demo...
FOR i = 0 TO LEN(a$)
j = j + 1: last = j
IF MID$(a$, i, 1) = " " OR i = 0 THEN
cnt = cnt + 1
REDIM _PRESERVE index(cnt), size(cnt)
index(cnt) = i + 1
size(cnt - 1) = j - 1: j = 0
END IF
NEXT
size(cnt) = last - 1
' For fun, print the index and size values...
FOR i = 1 TO UBOUND(index)
PRINT i; index(i); size(i)
NEXT
' Read and search using this indexing method.
i = 0
DO
i = i + 1
IF search$ = LCASE$(MID$(a$, index(i), size(i))) THEN found = 1: EXIT DO
LOOP
IF found THEN PRINT "Found: "; search$ ELSE PRINT "No search results.."
Pete
If eggs are brain food, Biden takes his scrambled.