Compara
(Comparar archivos y mostrar las diferencias)
Fecha: 26-Jun-97
Autor: Giovanni Rojas
Date sent: Thu, 12 Jun 1997
17:11:11 -0500
From: "Giovanni Rojas" grojas@emails.com
Esta rutina permite comparar dos
archivos y encuentra sus diferencias
! NO ESTA TERMINADO ! cualquier ayuda o consejo sera bienvenida
todo en vb5
El código de la rutina de comparación, el proyecto completo puedes bajarlo pulsando aquí (compara.zip 4.78 KB)
Option Explicit Dim sep As String Private Sub Command1_Click() Dim s1 As String Dim i1 As Long, l1 As Long Dim size As Long On Error GoTo res sep = Chr$(13) MousePointer = 11 RTF1.Text = RTF1.Text & Chr$(13) RTF2.Text = RTF2.Text & Chr$(13) size = Len(RTF1.Text) i1 = 1 Do l1 = InStr(i1, RTF1.Text, sep) s1 = Mid$(RTF1.Text, i1, l1 - i1) If (InStr(1, UCase(RTF2.Text), Trim(UCase(s1))) = 0) Then RTF1.SelStart = i1 RTF1.SelLength = l1 - i1 RTF1.SelBold = True i1 = l1 + 1 RTF1.SelLength = 0 RTF1.SelBold = False Else i1 = l1 + 1 End If Loop While (i1 < size) i1 = 1 Do l1 = InStr(i1, RTF2.Text, sep) s1 = Mid$(RTF2.Text, i1, l1 - i1) If (InStr(1, UCase(RTF1.Text), Trim(UCase(s1))) = 0) Then RTF2.SelStart = i1 RTF2.SelLength = l1 - i1 RTF2.SelBold = True i1 = l1 + 1 RTF2.SelLength = 0 RTF2.SelBold = False Else i1 = l1 + 1 End If Loop While (i1 < size) MsgBox "La Comparación a Finalizado" MousePointer = 0 res: 'Resume Next MousePointer = 0 End Sub