The code below do not works as expected. I mean, the code in the If Condition is never run.
NB: I used ComparisonOptions.Casesensitive sith the Same result.
ideas ?
If aLine.IndexOf("Europe,Afrique,Asie,Amérique,Océanie",ComparisonOptions.Caseinsensitive,French_Loc) <> -1 Then
No visual feedback I was avaiting, so I added System.DebugLog "In if block" and run: nothing.
The aLine string comes from a text file and holds a country name (simplified / expanded).
It is added in a ListBox (previous line).
And, yes, I have these Continent names in the text (aLine) at a moment.
This comes from a window that displays the list of countries by Continent in a ListBox; The If Block is here to add a Tag to change the background color for Continent name (only).
I used “EuropeAfriqueAsieAmériqueOcéanie” with the same failure.
Var aLine As String = "amÉrique"
Var validList As String = "Europe,Afrique,Asie,Amérique,Océanie,"
Var found As Boolean = validList.IndexOf(aLine.Trim+",") >= 0
If found Then MessageBox("Amérique was found!")
Const list As String = "Europe,Afrique,Asie,Amérique,Océanie"
Var aLine As String = "amérique"
Var options() As String = list.Split(",")
Var which As Integer = options.IndexOf(aLine.Trim)
Var found As Boolean = which >= 0
If found Then MessageBox("Found! It's "+options(which))
Quit
Var aLine As String = "amérique"
Select Case aline.Trim
case "Amérique"
MessageBox "Was #1, Amérique"
Case "Europe"
MessageBox "Was #2, Europe"
Else
MessageBox "Not found"
End
Select Case aLine
Case "Afrique","Amérique du nord","Amérique du sud","Asie","Europe","Océanie"
LB_Pays.CellTagAt(LB_Pays.LastAddedRowIndex,0) = "Continent"
End Select