Dim sListeOperateurs As String = "^*/+-" Dim op1 As String = "*" Dim op2 As String = "+" Debug.Print(sListeOperateurs.IndexOf(op1)) Debug.Print(sListeOperateurs.IndexOf(op2))
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionPrivate Function precedence(ByVal op1 As Char, ByVal operstack As Char) As Boolean If op1 = "^" Then Return True End If If op1 "*" And operstack "^" Then Return False End If If op1 "*" And (operstack "+" Or operstack = "-") Then Return True End If If op1 "/" And operstack "^" Then Return False End If If op1 "/" And (operstack "+" Or operstack = "-") Then Return True End If If op1 "+" And (operstack "^" Or operstack = "/" Or operstack = "*") Then Return False End If If op1 "+" And (operstack "-") Then Return True End If If op1 "-" And (operstack "^" Or operstack = "/" Or operstack = "*") Then Return False End If If op1 "-" And (operstack "+") Then Return True End If End Function