Alan71
Messages postés530Date d'inscriptionlundi 3 juin 2002StatutMembreDernière intervention13 juin 2004
-
13 sept. 2002 à 15:51
cs_Delirium
Messages postés30Date d'inscriptionvendredi 11 octobre 2002StatutMembreDernière intervention 3 mai 2004
-
29 juin 2004 à 18:37
Cette discussion concerne un article du site. Pour la consulter dans son contexte d'origine, cliquez sur le lien ci-dessous.
cs_Delirium
Messages postés30Date d'inscriptionvendredi 11 octobre 2002StatutMembreDernière intervention 3 mai 2004 29 juin 2004 à 18:37
moi je trouve plus simple->
if "*bonj*vb*e" Like "Bonjour Vb France !" then
(lol)
cs_max12
Messages postés1491Date d'inscriptiondimanche 19 novembre 2000StatutModérateurDernière intervention 7 juillet 2014 17 sept. 2002 à 02:23
Bin sur que c'est utile, si jme souvient bien Like n'est pas en ASP (ASP = VB + HTML), alors cette function serais très utile surtout sur ASPfr.com
@+
MajorDOOM
Messages postés28Date d'inscriptionmardi 2 juillet 2002StatutMembreDernière intervention 3 décembre 2005 13 sept. 2002 à 16:05
merci au fete pour cette astuce, je savais que cette operteur existait sous SQL mais j'avais jamais essayé en vb.. envore un truc qui sert a rien ;(
celiphane
Messages postés466Date d'inscriptionsamedi 16 février 2002StatutMembreDernière intervention20 avril 2007 13 sept. 2002 à 16:03
Exact, en plus tu pouvais quand même faire moins long, genre :
Private Function MieuxQueAsterisk(ByVal NomEntier As String, ByVal Nom As String) As Boolean
Dim i, j As Integer
If String(Len(Nom), "*") = Nom Then
MieuxQueAsterisk = True
Exit Function
End If
i = 0
j = 1
Do
i = i + 1
If Mid(Nom, i, 1) = "*" Then
Do
i = i + 1
Loop Until Mid(Nom, i, 1) <> "*" Or i = Len(Nom)
If i > Len(Nom) Then i = Len(Nom)
Do Until Mid(NomEntier, j, 1) = Mid(Nom, i, 1) Or j >= Len(NomEntier)
j = j + 1
Loop
End If
If Mid(NomEntier, j, 1) <> Mid(Nom, i, 1) And Mid(Nom, i, 1) <> "*" Then
MieuxQueAsterisk = False
Exit Function
Else
j = j + 1
End If
Loop Until j >= Len(NomEntier)
MieuxQueAsterisk = True
End Function
(fais en 10-15 minutes, à optimiser je pense...)
C'est tjrs bon de développer des codes existants pour les débutants... ici l'opérateur LIKE
Tch@o
MajorDOOM
Messages postés28Date d'inscriptionmardi 2 juillet 2002StatutMembreDernière intervention 3 décembre 2005 13 sept. 2002 à 15:58
non tu te trompe pas
Alan71
Messages postés530Date d'inscriptionlundi 3 juin 2002StatutMembreDernière intervention13 juin 2004 13 sept. 2002 à 15:51
Ouais, chez nous on appelle cette fonction Like (opérateur, pas fonction)...
Détompe moi si j'me plante !
29 juin 2004 à 18:37
if "*bonj*vb*e" Like "Bonjour Vb France !" then
(lol)
17 sept. 2002 à 02:23
@+
13 sept. 2002 à 16:05
13 sept. 2002 à 16:03
Private Function MieuxQueAsterisk(ByVal NomEntier As String, ByVal Nom As String) As Boolean
Dim i, j As Integer
If String(Len(Nom), "*") = Nom Then
MieuxQueAsterisk = True
Exit Function
End If
i = 0
j = 1
Do
i = i + 1
If Mid(Nom, i, 1) = "*" Then
Do
i = i + 1
Loop Until Mid(Nom, i, 1) <> "*" Or i = Len(Nom)
If i > Len(Nom) Then i = Len(Nom)
Do Until Mid(NomEntier, j, 1) = Mid(Nom, i, 1) Or j >= Len(NomEntier)
j = j + 1
Loop
End If
If Mid(NomEntier, j, 1) <> Mid(Nom, i, 1) And Mid(Nom, i, 1) <> "*" Then
MieuxQueAsterisk = False
Exit Function
Else
j = j + 1
End If
Loop Until j >= Len(NomEntier)
MieuxQueAsterisk = True
End Function
(fais en 10-15 minutes, à optimiser je pense...)
C'est tjrs bon de développer des codes existants pour les débutants... ici l'opérateur LIKE
Tch@o
13 sept. 2002 à 15:58
13 sept. 2002 à 15:51
Détompe moi si j'me plante !