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
| i = 0 ' Indice associé au vieux tableau
j = 0 ' Indice associé au nouveau tableau
'Recherche du tableau contenant le plus d'enregistrement
' ... imax ...
' ... jmax ...
If imax > jmax Then
max = imax
Else
max = jmax
End If
While i <> max And j <> max
If vieux(i, 0) = nouveau(j, 0) Then
If vieux(i, 1) = nouveau(i, 1) Then
MsgBox "Enregistrement " & vieux(i, 0) & " identique"
Else
MsgBox "Enregistrement " & vieux(i, 0) & " modifié"
End If
i = i + 1
j = j + 1
ElseIf vieux(i, 0) < nouveau(j, 0) Then
If vieux(i, 0) <> "" Then
MsgBox "Enregistrement " & vieux(i, 0) & " supprimé"
i = i + 1
Else
MsgBox "Enregistrement " & nouveau(j, 0) & " ajouté"
j = j + 1
End If
ElseIf vieux(i, 0) > nouveau(j, 0) Then
If nouveau(j, 0) <> "" Then
MsgBox "Enregistrement " & nouveau(j, 0) & " ajouté"
j = j + 1
Else
MsgBox "Enregistrement " & vieux(j, 0) & " supprimé"
i = i + 1
End If
End If
Wend |
Partager