home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 1_2002.ISO / Data / Zips / Module Com22378772001.psc / frmmain.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  2001-07-07  |  8.3 KB  |  261 lines

  1. VERSION 5.00
  2. Object = "{3B7C8863-D78F-101B-B9B5-04021C009402}#1.2#0"; "RICHTX32.OCX"
  3. Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
  4. Begin VB.MDIForm frmmain 
  5.    BackColor       =   &H8000000C&
  6.    Caption         =   "VB File Compare v1.0  <DarkMercenary44@cheapconnect.net>"
  7.    ClientHeight    =   7200
  8.    ClientLeft      =   165
  9.    ClientTop       =   450
  10.    ClientWidth     =   9780
  11.    Icon            =   "frmmain.frx":0000
  12.    LinkTopic       =   "MDIForm1"
  13.    StartUpPosition =   3  'Windows Default
  14.    Begin VB.PictureBox Picture1 
  15.       Align           =   3  'Align Left
  16.       Appearance      =   0  'Flat
  17.       BackColor       =   &H80000004&
  18.       BorderStyle     =   0  'None
  19.       ForeColor       =   &H80000008&
  20.       Height          =   6255
  21.       Left            =   0
  22.       ScaleHeight     =   6255
  23.       ScaleWidth      =   1980
  24.       TabIndex        =   8
  25.       Top             =   945
  26.       Width           =   1980
  27.       Begin RichTextLib.RichTextBox mstats 
  28.          Height          =   2475
  29.          Left            =   45
  30.          TabIndex        =   9
  31.          Top             =   210
  32.          Width           =   1860
  33.          _ExtentX        =   3281
  34.          _ExtentY        =   4366
  35.          _Version        =   393217
  36.          Enabled         =   0   'False
  37.          ReadOnly        =   -1  'True
  38.          TextRTF         =   $"frmmain.frx":0E42
  39.       End
  40.       Begin RichTextLib.RichTextBox cstats 
  41.          Height          =   2475
  42.          Left            =   45
  43.          TabIndex        =   11
  44.          Top             =   2970
  45.          Width           =   1860
  46.          _ExtentX        =   3281
  47.          _ExtentY        =   4366
  48.          _Version        =   393217
  49.          Enabled         =   0   'False
  50.          ReadOnly        =   -1  'True
  51.          TextRTF         =   $"frmmain.frx":0EC4
  52.       End
  53.       Begin VB.Label Label2 
  54.          Caption         =   "Compare File Stats"
  55.          Enabled         =   0   'False
  56.          Height          =   210
  57.          Left            =   300
  58.          TabIndex        =   12
  59.          Top             =   2760
  60.          Width           =   1320
  61.       End
  62.       Begin VB.Label Label1 
  63.          Caption         =   "Master File Stats"
  64.          Enabled         =   0   'False
  65.          Height          =   210
  66.          Left            =   360
  67.          TabIndex        =   10
  68.          Top             =   0
  69.          Width           =   1215
  70.       End
  71.    End
  72.    Begin VB.PictureBox pbTop 
  73.       Align           =   1  'Align Top
  74.       Appearance      =   0  'Flat
  75.       BackColor       =   &H80000004&
  76.       BorderStyle     =   0  'None
  77.       ForeColor       =   &H80000008&
  78.       Height          =   945
  79.       Left            =   0
  80.       ScaleHeight     =   945
  81.       ScaleWidth      =   9780
  82.       TabIndex        =   0
  83.       Top             =   0
  84.       Width           =   9780
  85.       Begin VB.CommandButton cmdhelp 
  86.          Caption         =   "Help"
  87.          Height          =   285
  88.          Left            =   5025
  89.          TabIndex        =   13
  90.          Top             =   600
  91.          Width           =   1245
  92.       End
  93.       Begin VB.CommandButton htile 
  94.          Caption         =   "Horizontal Tiling"
  95.          Enabled         =   0   'False
  96.          Height          =   285
  97.          Left            =   6870
  98.          TabIndex        =   7
  99.          Top             =   330
  100.          Width           =   2385
  101.       End
  102.       Begin VB.CommandButton vtile 
  103.          Caption         =   "Vertical Tiling"
  104.          Enabled         =   0   'False
  105.          Height          =   285
  106.          Left            =   6870
  107.          TabIndex        =   6
  108.          Top             =   60
  109.          Width           =   2385
  110.       End
  111.       Begin VB.CommandButton begin 
  112.          Caption         =   "Begin Comparision"
  113.          Height          =   210
  114.          Left            =   30
  115.          TabIndex        =   5
  116.          Top             =   675
  117.          Width           =   4935
  118.       End
  119.       Begin VB.CommandButton browse2 
  120.          Caption         =   "Browse"
  121.          Height          =   285
  122.          Left            =   5025
  123.          TabIndex        =   4
  124.          Top             =   330
  125.          Width           =   1245
  126.       End
  127.       Begin VB.CommandButton browse1 
  128.          Caption         =   "Browse"
  129.          Height          =   285
  130.          Left            =   5025
  131.          TabIndex        =   3
  132.          Top             =   60
  133.          Width           =   1245
  134.       End
  135.       Begin VB.TextBox txtcompare 
  136.          Height          =   285
  137.          Left            =   30
  138.          TabIndex        =   2
  139.          Text            =   "Compare File"
  140.          Top             =   330
  141.          Width           =   4935
  142.       End
  143.       Begin VB.TextBox txtmaster 
  144.          Height          =   285
  145.          Left            =   30
  146.          TabIndex        =   1
  147.          Text            =   "Master File"
  148.          Top             =   60
  149.          Width           =   4935
  150.       End
  151.    End
  152.    Begin MSComDlg.CommonDialog cd1 
  153.       Left            =   9225
  154.       Top             =   1020
  155.       _ExtentX        =   847
  156.       _ExtentY        =   847
  157.       _Version        =   393216
  158.    End
  159. Attribute VB_Name = "frmmain"
  160. Attribute VB_GlobalNameSpace = False
  161. Attribute VB_Creatable = False
  162. Attribute VB_PredeclaredId = True
  163. Attribute VB_Exposed = False
  164. Option Explicit
  165. Private Sub begin_Click()
  166. If txtmaster = "Master File" Or txtcompare = "Compare File" Then
  167.     MsgBox "You must specify a Master and Compare File", vbCritical, "YOU SCREWED UP"
  168.     Exit Sub
  169. End If
  170. Dim masterline As String
  171. Dim compareline As String
  172. Dim mlinecount As Integer
  173. Dim clinecount As Integer
  174. Dim diffcount As Integer
  175. Dim I As Integer
  176. Dim K As Integer
  177. newdoc(0).Show
  178. newdoc(0).Caption = "Master  <" & txtmaster.Text & ">"
  179. newdoc(1).Show
  180. newdoc(1).Caption = "Compare  <" & txtcompare.Text & ">"
  181. vtile.Enabled = True
  182. htile.Enabled = True
  183. mtxtadd ("===========================================================")
  184. mtxtadd ("Master File: " & txtmaster.Text)
  185. mtxtadd ("===========================================================")
  186. mtxtadd (" ")
  187. mtxtadd (" ")
  188. ctxtadd ("===========================================================")
  189. ctxtadd ("Compare File: " & txtcompare.Text)
  190. ctxtadd ("===========================================================")
  191. ctxtadd (" ")
  192. ctxtadd (" ")
  193. Open txtmaster.Text For Input As #1
  194. Do Until EOF(1)
  195.     Line Input #1, masterline
  196.     mlinecount = mlinecount + 1
  197. Close #1
  198. ReDim masterarray(mlinecount)
  199. mlinecount = 0
  200. Open txtmaster.Text For Input As #1
  201. Do Until EOF(1)
  202.     Line Input #1, masterline
  203.     masterarray(mlinecount) = masterline
  204.     mtxtadd (masterarray(mlinecount))
  205.     mlinecount = mlinecount + 1
  206. Close #1
  207. Open txtcompare.Text For Input As #1
  208. Do Until EOF(1)
  209.     Line Input #1, compareline
  210.     clinecount = clinecount + 1
  211. Close #1
  212. ReDim comparearray(clinecount)
  213. ReDim diffarray(clinecount)
  214. clinecount = 0
  215. Open txtcompare.Text For Input As #1
  216. Do Until EOF(1)
  217.     Line Input #1, compareline
  218.     comparearray(clinecount) = compareline
  219.     ctxtadd (comparearray(clinecount))
  220.     clinecount = clinecount + 1
  221. Close #1
  222. comparecount = clinecount
  223. mastertext = newdoc(0).rtext.Text
  224. comparetext = newdoc(1).rtext.Text
  225. DoEvents
  226. Call mstatsadd("Lines", mlinecount)
  227. Call cstatsadd("Lines", clinecount)
  228. For I = 0 To clinecount
  229.     If InStr(1, mastertext, comparearray(I)) = 0 Then
  230.         With newdoc(1).rtext
  231.             .SelStart = InStr(1, comparetext, comparearray(I)) - 1
  232.             .SelLength = Len(comparearray(I))
  233.             .SelColor = vbRed
  234.         End With
  235.         diffcount = diffcount + 1
  236.         diffarray(diffcount) = comparearray(I)
  237.     End If
  238. Next I
  239. DoEvents
  240. Call cstatsadd("Differences", diffcount)
  241. End Sub
  242. Private Sub browse1_Click()
  243. cd1.Filter = "Modules (*.bas)|*.bas|Forms (*.frm)|*.frm"
  244. cd1.ShowOpen
  245. txtmaster.Text = cd1.FileName
  246. End Sub
  247. Private Sub browse2_Click()
  248. cd1.Filter = "Modules (*.bas)|*.bas|Forms (*.frm)|*.frm"
  249. cd1.ShowOpen
  250. txtcompare.Text = cd1.FileName
  251. End Sub
  252. Private Sub cmdhelp_Click()
  253. Form1.Show vbModal
  254. End Sub
  255. Private Sub htile_Click()
  256. Me.Arrange vbTileHorizontal
  257. End Sub
  258. Private Sub vtile_Click()
  259. Me.Arrange vbTileVertical
  260. End Sub
  261.