Arreter et reprendre un FOR
Bonjour,
Je suis en train de faire une recherche dans une liste de nom (csv) avec des homonymes.
Je souhaiterais, soit qu'il me propose une liste de tout ce qu'il trouve en fonction de ma demande, soit que je puisse faire "suivant" si ce n'est pas le bon.
Ex : je tape "TOTO", il me propose "TOTO Eric", "TOTO Jacques", "TOTO Pierre" etc
Actuellement, il ne me propose que le dernier de la liste.
Voici mon code actuel :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
|
Using MyReader As New Microsoft.VisualBasic.FileIO.TextFieldParser("C:\liste.csv")
MyReader.TextFieldType = FileIO.FieldType.Delimited
MyReader.SetDelimiters(";")
Dim currentRow As String()
While Not MyReader.EndOfData
Try
currentRow = MyReader.ReadFields()
Dim currentField As String
'affiche le resultat
For Each currentField In currentRow
If currentRow(0).Contains(TextBox1.Text) Then
Label8.Text = currentRow(1)
Label9.Text = currentRow(2)
Label10.Text = currentRow(3)
Label11.Text = currentRow(7)
Label12.Text = currentRow(4)
End If
Next
End While
End Using |
Merci