PDA

Click to See Complete Forum and Search --> : InStr function is useful; do we have an equivalent for arrays?


Jan 28th, 2000, 02:50 AM
MyStr = "abcde"
msgbox InStr(MyStr,"c")

I'll get a message "3" 'cause c is in 3rd position in MyStr string

do we have a function
If I got an array MyArr(0) = "a" etc...

thanks

netSurfer
Jan 28th, 2000, 02:54 AM
I don't knonw if there is a function but you could build one.

dim strTemp() as string, intI as integer

redim strTemp(4)

for inti = 0 to 4
if strtemp(inti) = "a" then
msgobx "This array location:" & inti, vbokonly, "Array location"
exit for
end if
next inti

Jan 28th, 2000, 02:55 AM
sure but looping is always slower than using built in functions

thanks anyway