Thanks for the speedy reply. I have made the change and it no longer crashes. However, I can't get the routine to work still. Maybe you can help?
Say I populate ServerBank$ very sparsley like so:
ServerBank$(1, 1) = "crapbank.com"
ServerBank$(2, 1) = "mail.com"
ServerBank$(3, 1) = "news.com"
ServerBank$(4, 1) = "betterbank.com"
I want the user to be able to search this array to see if the 'server' they want to connect to exists. This is stored in TempChoice$
I am trying to write a routine that will search through ServerBank$(x, 1) looking for that string. I then want to be able to record which x value each successful match was at. For instance, if TempChoice$ is "bank" I would like the routine to record the numbers 1 and 4 (as (1, 1) and (4, 1) both contain the word bank in their string).
I was trying to store these numbers in a separate array called TempStorage. So, for instance,
TempStorage(1) = 1 and TempStorage(2) = 4, in this case
I am assuming that if the search string is present in the source string (I think TempChoice$ is the search string and ServerBank$ is the source?) then INSTR will return an integer other than 0?
What is wrong with this code then?
INPUT TempChoice$
FOR z = 1 TO 100
TempStorage(z) = 0
NEXT z
FOR a = 1 TO 100
TempSearch = 0
TempSearch = INSTR(ServerBank$(a, 1)+"", TempChoice$)
IF TempSearch <> 0
`Find the next empty space in TempStorage)
FOR b = 1 TO 100
IF TempStorage(b) = 0
TempStorage(b) = a
ENDIF
NEXT b
ENDIF
NEXT a