HI, I am sure that this has been asked before, but I can't seem to find the answer, so apologies for that.

I have 5 arrays, imaginatively named, array1 array2 etc. I want to operate on them via a for next loop. The pseudo code would look like this I guess :

dim token as integer = 'something'
dim array1 as integer {1,2,3,4,5}
dim array2 as ineger {1,2,3,4,5} 
etc for rest of arrays 
for i as integer = 1 to 5
if array(i,token) = 'something' then 
 perform calculation
end if
next i

How would I code that so that it works please?
Thanks for all and any help.

7 Years
Discussion Span
Last Post by jbisono

Hi, I do not really understand what is your goal with this code, first of all this line does not seem right to me.

dim token as integer = 'something'

but anyway i think what you want is this.

Dim token As Integer = 3
        Dim Array1(,) As Integer = {{1, 2, 3, 4, 5}, {1, 2, 3, 4, 5}}
        For i As Integer = 0 To 1
            For a As Integer = 0 To 4
                If Array1(i, a) = token Then
                    TextBox1.Text += "Should Find Number 3 two times"
                End If
            Next a
        Next i


This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.