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 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
   |  
Private Sub runBASEupdate(ByRef tbFTP(,) As String, ByRef tbLocal(,) As String, ByVal ii As Integer, ByRef cptFALL As Integer, ByVal cptAall As Integer)
 
        'runBASEupdate(tbClientFTP, tbClientLocal, 11, cptcllocal, cptclftp)
 
        Dim resultat As Integer = 0
 
        Dim cptA, cptF As Integer
 
        For cptF = 0 To 999999
            resultat = 0
            If tbFTP(cptF, 1) <> Nothing Then
                For cptA = 0 To cptAall
 
                    Dim val = tbFTP(cptF, 2)
                    Dim val1 = tbLocal(cptA, 2)
                    If tbFTP(cptF, 2) = tbLocal(cptA, 2) Then
                        resultat = 0
                        Exit For
                    Else
                        resultat = 1
                    End If
                Next
                If resultat = 0 Then
                    Dim result As Integer = DateTime.Compare(tbLocal(cptA, 1), tbFTP(cptF, 1))
                    If result < 0 Then
                        'inférieur
                        For iii = 0 To ii
                            tbLocal(cptA, iii) = tbFTP(cptF, iii)
                        Next
                    ElseIf result = 0 Then
                        'egal
                    Else
                        'supérieur
                    End If
                ElseIf resultat = 1 Then
                    For iii = 0 To ii
                        tbLocal(cptFALL, iii) = tbFTP(cptF, iii)
                    Next
                    cptFALL += 1
                End If
            Else
                Exit For
            End If
        Next
    End Sub |