21 lines
446 B
Plaintext
21 lines
446 B
Plaintext
list$ = "mouse,hat,cup,deodorant,television,soap,methamphetamine,severed cat heads,cup"
|
|
|
|
dim item$(1)
|
|
|
|
n = token(list$, item$(), ",")
|
|
|
|
line input "Enter string to search: " line$
|
|
for i = 1 to n
|
|
if line$ = item$(i) then
|
|
if not t print "First index for ", line$, ": ", i
|
|
t = i
|
|
j = j + 1
|
|
end if
|
|
next
|
|
|
|
if t = 0 then
|
|
print "String not found in list"
|
|
else
|
|
if j > 1 print "Last index for ", line$, ": ", t
|
|
end if
|