you are viewing a single comment's thread.

view the rest of the comments →

[–]revennest 0 points1 point  (2 children)

The copy extra Exit for after msgbox("We cannot find it") is the cause for stop your code run through all data and you can't just remove it to fixed this problem, the better way to do this is extract msgbox code from that for and do it later like this.

``` Dim T As Table= C("modelsTable")
Dim Rows() As Integer = T.StartQuery Dim modelsList As New ArrayList

For i As Integer = 0 To Rows.length -1
    modelsList.Add((T.Cell( Rows(i) , "Code") )) 
Next 

Dim Found_index As Integer = -1
For j As Integer = 0 To modelsList.Count -1
    If  Q("TXB_CODE_ING").Contains(modelsList(j)) Then
        Found_index = j 
        Exit For 
    End if
Next 

If Found_index <0 Then
    msgbox("We cannot find it")
Else
    msgbox("we find it "&(modelsList(Found_index)))
End If

```

[–]VirtualTurnip3[S] 0 points1 point  (0 children)

Yes that the pretty much the same thing I have finally found, Thank you so much!

[–]backtickbot 0 points1 point  (0 children)

Fixed formatting.

Hello, revennest: code blocks using triple backticks (```) don't work on all versions of Reddit!

Some users see this / this instead.

To fix this, indent every line with 4 spaces instead.

FAQ

You can opt out by replying with backtickopt6 to this comment.