Aide en vb6

soleildz Messages postés 58 Date d'inscription dimanche 19 avril 2009 Statut Membre Dernière intervention 10 février 2016 - 31 juil. 2003 à 12:35
nhervagault Messages postés 6063 Date d'inscription dimanche 13 avril 2003 Statut Membre Dernière intervention 15 juillet 2011 - 31 juil. 2003 à 14:30
peux tu m'aider?merci d'avance.

voila une partie d'un module.

Public Function FiltresD(ByVal Comb As String, ListesD As ListBox, N As Long) As Boolean
Dim i As Long, l As Long, noccur As Byte
Dim tabl() As Long, ws As String
On Error GoTo Filtre_Err

l = ListesD.ListCount

FiltresD = True
Combi = ListToArray(Comb).....ici
compteur = 0
For i = 0 To l - 1
tabl = ListToArray(ListesD.List(i))............ici
noccur = NbreOccurence(tabl, Combi).....ici
If noccur = UBound(Combi) Then.........ici
compteur = compteur + 1
End If
Next i

If s = 2 Then
If compteur <> N Then
FiltresD = False

End If
End If



If s = 1 Then
If compteur < N Then
FiltresD = False
End If
End If

If s = 3 Then
If compteur > N Then
FiltresD = False
End If
End If



If s > 3 Then
If compteur > N Or compteur < 1 Then
FiltresD = False
End If
End If

Exit Function

Filtre_Err:
Call ErrorHandler(Err.Number)
End Function

comb est de la forme 1/2/3/

ListesD.List(i) contient 8 elements chacune :exemple

1/2/5/7/8/9/11/3 (1)
1/7/9/10/3/15/18/2 (2)
18/2/5/3/1/7/9/4 (3)
.
.
.
je veux par exemple eliminer 1/2/3 ds cet ordre des listes ListesD.List(i) et garder
1/3/2 en (2) et 2/3/1 en (3)

merci d'avance

1 réponse

nhervagault Messages postés 6063 Date d'inscription dimanche 13 avril 2003 Statut Membre Dernière intervention 15 juillet 2011 37
31 juil. 2003 à 14:30
Utilises les fonctions

split
join
instr

Elles font peutre t'aider a resoudre ton pb que j'ai un peu de mal a comprendre.

split ---> decoupe une chaine dans un tableau
my_array = split (yourString ,"/")

join ---> join un tableau pour faire une string
my_new_string = join (my_array,"/")

instr ---> position d'un caractere dans une string

peut etre ces differentes fonctions vont resoudre ton pb
0
Rejoignez-nous