home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 1_2002.ISO / Data / Zips / CODE_UPLOAD171223162001.psc / frmGreta.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  2001-03-12  |  43.4 KB  |  1,116 lines

  1. VERSION 5.00
  2. Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
  3. Object = "{6B7E6392-850A-101B-AFC0-4210102A8DA7}#1.2#0"; "COMCTL32.OCX"
  4. Begin VB.Form frmGreta 
  5.    BorderStyle     =   1  'Fixed Single
  6.    Caption         =   "WinGrep version 1.3"
  7.    ClientHeight    =   7740
  8.    ClientLeft      =   45
  9.    ClientTop       =   330
  10.    ClientWidth     =   8340
  11.    Icon            =   "frmGreta.frx":0000
  12.    LinkTopic       =   "Form1"
  13.    MaxButton       =   0   'False
  14.    MinButton       =   0   'False
  15.    ScaleHeight     =   7740
  16.    ScaleWidth      =   8340
  17.    StartUpPosition =   3  'Windows Default
  18.    Begin VB.Frame fraCommandLine 
  19.       Caption         =   "Command"
  20.       Height          =   1095
  21.       Left            =   0
  22.       TabIndex        =   49
  23.       Top             =   6000
  24.       Width           =   8295
  25.       Begin VB.CommandButton cmdSaveToHS3 
  26.          Height          =   375
  27.          Left            =   6720
  28.          MaskColor       =   &H00FFFFFF&
  29.          Picture         =   "frmGreta.frx":0442
  30.          Style           =   1  'Graphical
  31.          TabIndex        =   35
  32.          ToolTipText     =   "Assign Current Information To Hot Search Button 3"
  33.          Top             =   600
  34.          UseMaskColor    =   -1  'True
  35.          Width           =   255
  36.       End
  37.       Begin VB.CommandButton cmdSaveToHS2 
  38.          Height          =   375
  39.          Left            =   5280
  40.          MaskColor       =   &H00FFFFFF&
  41.          Picture         =   "frmGreta.frx":0628
  42.          Style           =   1  'Graphical
  43.          TabIndex        =   33
  44.          ToolTipText     =   "Assign Current Information To Hot Search Button 2"
  45.          Top             =   600
  46.          UseMaskColor    =   -1  'True
  47.          Width           =   255
  48.       End
  49.       Begin VB.CommandButton cmdSaveToHS1 
  50.          Height          =   375
  51.          Left            =   3840
  52.          MaskColor       =   &H00FFFFFF&
  53.          Picture         =   "frmGreta.frx":080E
  54.          Style           =   1  'Graphical
  55.          TabIndex        =   31
  56.          ToolTipText     =   "Assign Current Information To Hot Search Button 1"
  57.          Top             =   600
  58.          UseMaskColor    =   -1  'True
  59.          Width           =   255
  60.       End
  61.       Begin VB.CommandButton cmdHotButton3 
  62.          Caption         =   "Hot Search (&3)"
  63.          Height          =   375
  64.          Left            =   6960
  65.          TabIndex        =   36
  66.          Top             =   600
  67.          Width           =   1215
  68.       End
  69.       Begin VB.CommandButton cmdHotButton2 
  70.          Caption         =   "Hot Search (&2)"
  71.          Height          =   375
  72.          Left            =   5520
  73.          TabIndex        =   34
  74.          Top             =   600
  75.          Width           =   1215
  76.       End
  77.       Begin VB.CommandButton cmdHotButton1 
  78.          Caption         =   "Hot Search (&1)"
  79.          Height          =   375
  80.          Left            =   4080
  81.          TabIndex        =   32
  82.          Top             =   600
  83.          Width           =   1215
  84.       End
  85.       Begin VB.CommandButton cmdLoad 
  86.          Caption         =   "Loa&d..."
  87.          Height          =   375
  88.          Left            =   2520
  89.          TabIndex        =   30
  90.          ToolTipText     =   "Load a previously saved Grep script"
  91.          Top             =   600
  92.          Width           =   1215
  93.       End
  94.       Begin VB.CommandButton cmdSaveGrep 
  95.          Caption         =   "S&ave..."
  96.          Height          =   375
  97.          Left            =   1320
  98.          TabIndex        =   29
  99.          ToolTipText     =   "Save the current grep script for later use"
  100.          Top             =   600
  101.          Width           =   1215
  102.       End
  103.       Begin VB.CommandButton cmdPropogateUp 
  104.          Caption         =   "&Propogate Up"
  105.          Height          =   375
  106.          Left            =   120
  107.          TabIndex        =   28
  108.          ToolTipText     =   "Update all input boxes above from Command Line"
  109.          Top             =   600
  110.          Width           =   1215
  111.       End
  112.       Begin VB.TextBox txtCommand 
  113.          Height          =   285
  114.          Left            =   1440
  115.          MultiLine       =   -1  'True
  116.          ScrollBars      =   2  'Vertical
  117.          TabIndex        =   27
  118.          Top             =   240
  119.          Width           =   6735
  120.       End
  121.       Begin VB.Label lblCommand 
  122.          Caption         =   "C&ommand Line:"
  123.          Height          =   255
  124.          Left            =   120
  125.          TabIndex        =   50
  126.          Top             =   240
  127.          Width           =   1095
  128.       End
  129.    End
  130.    Begin ComctlLib.ProgressBar pb1 
  131.       Height          =   135
  132.       Left            =   0
  133.       TabIndex        =   43
  134.       Top             =   7560
  135.       Width           =   3615
  136.       _ExtentX        =   6376
  137.       _ExtentY        =   238
  138.       _Version        =   327682
  139.       Appearance      =   1
  140.    End
  141.    Begin VB.CommandButton cmdClose 
  142.       Cancel          =   -1  'True
  143.       Caption         =   "&Close"
  144.       Height          =   495
  145.       Left            =   6840
  146.       TabIndex        =   2
  147.       Top             =   7200
  148.       Width           =   1455
  149.    End
  150.    Begin VB.CommandButton cmdReset 
  151.       Caption         =   "&Reset"
  152.       Height          =   495
  153.       Left            =   5280
  154.       TabIndex        =   1
  155.       Top             =   7200
  156.       Width           =   1455
  157.    End
  158.    Begin VB.Frame fraInputFiles 
  159.       Caption         =   "Input Options"
  160.       Height          =   2895
  161.       Left            =   0
  162.       TabIndex        =   40
  163.       Top             =   1200
  164.       Width           =   8295
  165.       Begin VB.ComboBox cboFilesToFind 
  166.          Enabled         =   0   'False
  167.          Height          =   315
  168.          ItemData        =   "frmGreta.frx":09F4
  169.          Left            =   1680
  170.          List            =   "frmGreta.frx":0A0D
  171.          TabIndex        =   17
  172.          Top             =   2520
  173.          Width           =   3855
  174.       End
  175.       Begin VB.CommandButton cmdBrowseFolders 
  176.          Caption         =   "Browse.."
  177.          Enabled         =   0   'False
  178.          Height          =   375
  179.          Left            =   5520
  180.          TabIndex        =   15
  181.          Top             =   2160
  182.          Width           =   975
  183.       End
  184.       Begin VB.CheckBox chkRecurseSubFolders 
  185.          Alignment       =   1  'Right Justify
  186.          Caption         =   "Recu&rse SubFolders?"
  187.          Enabled         =   0   'False
  188.          Height          =   375
  189.          Left            =   6720
  190.          TabIndex        =   16
  191.          Top             =   2160
  192.          Width           =   1455
  193.       End
  194.       Begin VB.TextBox txtFolder 
  195.          Enabled         =   0   'False
  196.          Height          =   285
  197.          Left            =   1680
  198.          TabIndex        =   14
  199.          Text            =   "C:\"
  200.          Top             =   2160
  201.          Width           =   3855
  202.       End
  203.       Begin VB.CheckBox chkFindFiles 
  204.          Alignment       =   1  'Right Justify
  205.          Caption         =   "&Find Files"
  206.          Height          =   255
  207.          Left            =   120
  208.          TabIndex        =   13
  209.          Top             =   2160
  210.          Width           =   975
  211.       End
  212.       Begin VB.CommandButton cmdFindFiles 
  213.          Caption         =   "Fi&nd..."
  214.          Height          =   375
  215.          Left            =   7200
  216.          TabIndex        =   12
  217.          Top             =   1680
  218.          Width           =   975
  219.       End
  220.       Begin ComctlLib.ListView lvwInputFiles 
  221.          Height          =   1815
  222.          Left            =   1680
  223.          TabIndex        =   7
  224.          Top             =   240
  225.          Width           =   5535
  226.          _ExtentX        =   9763
  227.          _ExtentY        =   3201
  228.          View            =   3
  229.          LabelEdit       =   1
  230.          MultiSelect     =   -1  'True
  231.          LabelWrap       =   -1  'True
  232.          HideSelection   =   -1  'True
  233.          OLEDropMode     =   1
  234.          _Version        =   327682
  235.          ForeColor       =   -2147483640
  236.          BackColor       =   -2147483643
  237.          BorderStyle     =   1
  238.          Appearance      =   1
  239.          OLEDropMode     =   1
  240.          NumItems        =   4
  241.          BeginProperty ColumnHeader(1) {0713E8C7-850A-101B-AFC0-4210102A8DA7} 
  242.             Key             =   ""
  243.             Object.Tag             =   ""
  244.             Text            =   "File Name"
  245.             Object.Width           =   2540
  246.          EndProperty
  247.          BeginProperty ColumnHeader(2) {0713E8C7-850A-101B-AFC0-4210102A8DA7} 
  248.             SubItemIndex    =   1
  249.             Key             =   ""
  250.             Object.Tag             =   ""
  251.             Text            =   "Size"
  252.             Object.Width           =   2540
  253.          EndProperty
  254.          BeginProperty ColumnHeader(3) {0713E8C7-850A-101B-AFC0-4210102A8DA7} 
  255.             SubItemIndex    =   2
  256.             Key             =   ""
  257.             Object.Tag             =   ""
  258.             Text            =   "Modified"
  259.             Object.Width           =   2540
  260.          EndProperty
  261.          BeginProperty ColumnHeader(4) {0713E8C7-850A-101B-AFC0-4210102A8DA7} 
  262.             SubItemIndex    =   3
  263.             Key             =   ""
  264.             Object.Tag             =   ""
  265.             Text            =   ""
  266.             Object.Width           =   2540
  267.          EndProperty
  268.       End
  269.       Begin VB.CommandButton cmdChangeListView 
  270.          Caption         =   "C&hange..."
  271.          Height          =   375
  272.          Left            =   7200
  273.          TabIndex        =   11
  274.          Top             =   1320
  275.          Width           =   975
  276.       End
  277.       Begin VB.CommandButton cmdRemoveFromListView 
  278.          Caption         =   "Remo&ve"
  279.          Height          =   375
  280.          Left            =   7200
  281.          TabIndex        =   10
  282.          Top             =   960
  283.          Width           =   975
  284.       End
  285.       Begin VB.CommandButton cmdClearListView 
  286.          Caption         =   "C&lear All"
  287.          Height          =   375
  288.          Left            =   7200
  289.          TabIndex        =   9
  290.          Top             =   600
  291.          Width           =   975
  292.       End
  293.       Begin VB.CommandButton cmdAddToListView 
  294.          Caption         =   "&Add..."
  295.          Height          =   375
  296.          Left            =   7200
  297.          TabIndex        =   8
  298.          Top             =   240
  299.          Width           =   975
  300.       End
  301.       Begin VB.Label lblFilesToFind 
  302.          Caption         =   "Files To Find:"
  303.          Enabled         =   0   'False
  304.          Height          =   255
  305.          Left            =   120
  306.          TabIndex        =   52
  307.          Top             =   2520
  308.          Width           =   1455
  309.       End
  310.       Begin VB.Label lblFolder 
  311.          Caption         =   "Folder"
  312.          Height          =   255
  313.          Left            =   1200
  314.          TabIndex        =   51
  315.          Top             =   2160
  316.          Width           =   495
  317.       End
  318.       Begin VB.Label lblFilesToAnalyse 
  319.          Caption         =   "Files to Analyse:"
  320.          Height          =   615
  321.          Left            =   120
  322.          TabIndex        =   41
  323.          Top             =   240
  324.          Width           =   1335
  325.       End
  326.    End
  327.    Begin VB.Frame fraOutput 
  328.       Caption         =   "Output Options"
  329.       Height          =   1935
  330.       Left            =   0
  331.       TabIndex        =   39
  332.       Top             =   4080
  333.       Width           =   8295
  334.       Begin VB.ComboBox cboIncludeSeperator 
  335.          Height          =   315
  336.          ItemData        =   "frmGreta.frx":0A73
  337.          Left            =   5160
  338.          List            =   "frmGreta.frx":0A80
  339.          Style           =   2  'Dropdown List
  340.          TabIndex        =   22
  341.          Top             =   840
  342.          Width           =   3015
  343.       End
  344.       Begin VB.ComboBox cboDispFileNames 
  345.          Height          =   315
  346.          ItemData        =   "frmGreta.frx":0AB5
  347.          Left            =   1680
  348.          List            =   "frmGreta.frx":0AC2
  349.          Style           =   2  'Dropdown List
  350.          TabIndex        =   21
  351.          Top             =   840
  352.          Width           =   1695
  353.       End
  354.       Begin VB.CheckBox chkOnlyACount 
  355.          Alignment       =   1  'Right Justify
  356.          Caption         =   "Display only a count of &matching lines"
  357.          Height          =   255
  358.          Left            =   5160
  359.          TabIndex        =   24
  360.          Top             =   1200
  361.          Width           =   3015
  362.       End
  363.       Begin VB.TextBox txtPostLinesToOutput 
  364.          Height          =   285
  365.          Left            =   4200
  366.          TabIndex        =   26
  367.          Text            =   "0"
  368.          Top             =   1560
  369.          Width           =   375
  370.       End
  371.       Begin VB.TextBox txtPreviousLinesToOutput 
  372.          Height          =   285
  373.          Left            =   2280
  374.          TabIndex        =   25
  375.          Text            =   "0"
  376.          Top             =   1560
  377.          Width           =   375
  378.       End
  379.       Begin VB.CommandButton cmdBrowseOutputFile 
  380.          Caption         =   "Browse..."
  381.          Enabled         =   0   'False
  382.          Height          =   375
  383.          Left            =   7200
  384.          TabIndex        =   20
  385.          Top             =   360
  386.          Width           =   975
  387.       End
  388.       Begin VB.TextBox txtOutputFile 
  389.          Enabled         =   0   'False
  390.          Height          =   405
  391.          Left            =   2160
  392.          TabIndex        =   19
  393.          Top             =   360
  394.          Width           =   5055
  395.       End
  396.       Begin VB.CheckBox chkOutputToFile 
  397.          Alignment       =   1  'Right Justify
  398.          Caption         =   "&Output to file?"
  399.          Height          =   255
  400.          Left            =   120
  401.          TabIndex        =   18
  402.          Top             =   360
  403.          Width           =   1815
  404.       End
  405.       Begin VB.CheckBox chkLineNumbers 
  406.          Alignment       =   1  'Right Justify
  407.          Caption         =   "Show &Line Numbers?"
  408.          Height          =   255
  409.          Left            =   120
  410.          TabIndex        =   23
  411.          Top             =   1200
  412.          Width           =   1815
  413.       End
  414.       Begin VB.Label lblSeperator 
  415.          Caption         =   "Include Seperator?"
  416.          Height          =   255
  417.          Left            =   3600
  418.          TabIndex        =   48
  419.          Top             =   840
  420.          Width           =   1455
  421.       End
  422.       Begin VB.Label lblDispFilenames 
  423.          Caption         =   "Display Filenames?"
  424.          Height          =   255
  425.          Left            =   120
  426.          TabIndex        =   47
  427.          Top             =   840
  428.          Width           =   1455
  429.       End
  430.       Begin VB.Label Label5 
  431.          Caption         =   "Post Lines"
  432.          Height          =   255
  433.          Left            =   4680
  434.          TabIndex        =   46
  435.          Top             =   1560
  436.          Width           =   855
  437.       End
  438.       Begin VB.Label Label4 
  439.          Caption         =   "Previous Lines and "
  440.          Height          =   255
  441.          Left            =   2760
  442.          TabIndex        =   45
  443.          Top             =   1560
  444.          Width           =   1455
  445.       End
  446.       Begin VB.Label Label3 
  447.          Caption         =   "If Match is found then output"
  448.          Height          =   255
  449.          Left            =   120
  450.          TabIndex        =   44
  451.          Top             =   1560
  452.          Width           =   2055
  453.       End
  454.    End
  455.    Begin VB.Frame fraReg 
  456.       Caption         =   "Regular Expression"
  457.       Height          =   1095
  458.       Left            =   0
  459.       TabIndex        =   37
  460.       Top             =   0
  461.       Width           =   8295
  462.       Begin VB.CheckBox chkExact 
  463.          Alignment       =   1  'Right Justify
  464.          Caption         =   "&Exact Line Matching?"
  465.          Height          =   255
  466.          Left            =   2520
  467.          TabIndex        =   5
  468.          Top             =   720
  469.          Width           =   2295
  470.       End
  471.       Begin VB.CheckBox chkCase 
  472.          Alignment       =   1  'Right Justify
  473.          Caption         =   "Case &Sensitive?"
  474.          Height          =   255
  475.          Left            =   6240
  476.          TabIndex        =   6
  477.          Top             =   720
  478.          Width           =   1935
  479.       End
  480.       Begin VB.CheckBox chkInvert 
  481.          Alignment       =   1  'Right Justify
  482.          Caption         =   "&Invert Selection?"
  483.          Height          =   255
  484.          Left            =   120
  485.          TabIndex        =   4
  486.          Top             =   720
  487.          Width           =   1815
  488.       End
  489.       Begin VB.TextBox txtReg 
  490.          Height          =   405
  491.          Left            =   1680
  492.          TabIndex        =   3
  493.          Top             =   240
  494.          Width           =   6495
  495.       End
  496.       Begin VB.Label Label1 
  497.          Caption         =   "Regular Expression"
  498.          Height          =   375
  499.          Left            =   120
  500.          TabIndex        =   38
  501.          Top             =   240
  502.          Width           =   1575
  503.       End
  504.    End
  505.    Begin VB.CommandButton cmdOk 
  506.       Caption         =   "&Ok"
  507.       Default         =   -1  'True
  508.       Height          =   495
  509.       Left            =   3720
  510.       TabIndex        =   0
  511.       Top             =   7200
  512.       Width           =   1455
  513.    End
  514.    Begin MSComDlg.CommonDialog cdb1 
  515.       Left            =   0
  516.       Top             =   7320
  517.       _ExtentX        =   847
  518.       _ExtentY        =   847
  519.       _Version        =   393216
  520.    End
  521.    Begin VB.Label lblProcess 
  522.       Height          =   375
  523.       Left            =   120
  524.       TabIndex        =   42
  525.       Top             =   7200
  526.       Width           =   3495
  527.    End
  528. Attribute VB_Name = "frmGreta"
  529. Attribute VB_GlobalNameSpace = False
  530. Attribute VB_Creatable = False
  531. Attribute VB_PredeclaredId = True
  532. Attribute VB_Exposed = False
  533. Option Explicit
  534. Option Compare Text
  535. Option Base 0
  536. 'WinGrep version 1.3
  537. 'For all those UNIX people out there, "grep" should need little
  538. 'introduction.  It is simply a powerful tool for extracting lines
  539. 'from files.  This is the GUI version for Windows.
  540. 'To those of you who don't know UNIX, "grep" looks for lines matching a
  541. 'regular expression in a file, and if it finds a matching line, then
  542. 'it outputs it to a new file.  For an explanation of "regular
  543. 'expressions " please examine the VB help on the " Like " operator."
  544. 'For example if I have a file containing the lines
  545. 'Good Morning
  546. 'and how
  547. 'you?
  548. 'Good Afternoon
  549. 'and Goodbye!
  550. 'And put the following regular expression into WinGrep and run it
  551. '"Good"
  552. 'then the following lines will be added into the output file:
  553. 'Good Morning
  554. 'Good Afternoon
  555. 'and Goodbye!
  556. 'Up to 10 Regular expressions may be specified in WinGrep by putting
  557. 'semicolons between the Regular expressions.
  558. 'For example, if I was looking for either the words "Good" or "you" then
  559. 'my regular expression would be: "Good;you"
  560. 'and my output would be:
  561. 'Good Morning
  562. 'you?
  563. 'Good Afternoon
  564. 'and Goodbye!
  565. 'Characters in pattern Matches in string:
  566. '? Any single character.
  567. '* Zero or more characters.
  568. '# Any single digit (0-9).
  569. '[charlist] Any single character in charlist.
  570. '[!charlist] Any single character not in charlist.
  571. 'I know this help file is short - if you need any more information you
  572. 'can contact me at bigcalm@hotmail.com
  573. 'Bug fixes, Improvements, and Suggestions are most welcome too.
  574. ' New functionality for Version 1.1
  575. ' 1) Pre-Post line extraction
  576. ' 2) Counting facility
  577. ' 3) Find-Files is now finished.
  578. ' Numerous minor bug-fixes.
  579. ' New functionality for Version 1.2
  580. ' 1) UNIX Command Line style text box for those moving to WinGrep from Unix or Dos Grep
  581. ' 2) Load and Save searches
  582. ' 3) "HOT" (quick search) buttons for those regular searches (registry keys)
  583. ' 4) Improved file finding dialog on main form.
  584. ' 5) DisplayFilenames option changed + Seperator included.
  585. ' 6) Can be run from the command line and explorer.  i.e. It processes it's arguments, and now runs using a Sub Main() procedure.
  586. ' 7) Post-extraction works correctly now.
  587. ' 8) I've put some comments into the Grep functions, 'cos they were getting horribly complex.
  588. ' 9) Silent modes for command line running
  589. ' 10) Example files included.
  590. ' New functionality for Version 1.3 (bug fixes mainly).
  591. ' 1) If JustCountThem And DisplayFileNames = OncePerFile then don't have any output if matches = 0 for that file
  592. ' 2) More than 10 regular expressions!  I thought 10 was easily enough, but no.
  593. ' 3) Improved modularity using compiler directives.
  594. ' 4) Removed disgusting common dialog and listview hacks (and replaced with ones almost as bad, sigh).
  595. ' 5) Numerous bugs in WorkOutGrepCommand() and PropagateUp() fixed.
  596. ' 6) Move to using Windows temp directory for default output files, and add cleardown routine.
  597. ' 7) Multiple concurrent searches (in different applications).
  598. ' 8) Automatic registration of script files for use with explorer.
  599. ' Further improvements that people have asked for....
  600. ' 1) Awk! (They don't ask for this directly, but practically, an Awk scripting language is what they need).
  601. '         - They can bog off unless they offer me a fat cheque or some seriously
  602. '           good parsing code or source code for a compiler (not fussy which language, excepting Prolog and LISP).
  603. #Const VBHardCore = False ' If you have Bruce McKinley's VBCore library,
  604.     ' setting this compiler directive to True makes for better looking dialog boxes
  605.     ' available from www.mvps.org/vb/hardcore
  606. Public Running As Boolean
  607. Private Stopping As Boolean
  608. Private DoNotCallWorkOutGrep As Boolean
  609. Private Sub cboDispFileNames_Click()
  610. If DoNotCallWorkOutGrep = False Then
  611.     WorkOutGrepCommand
  612. End If
  613. End Sub
  614. Private Sub cboFilesToFind_Change()
  615.     WorkOutGrepCommand
  616. End Sub
  617. Private Sub cboFilesToFind_Click()
  618.     WorkOutGrepCommand
  619. End Sub
  620. Private Sub cboIncludeSeperator_Change()
  621.     WorkOutGrepCommand
  622. End Sub
  623. Private Sub cboIncludeSeperator_Click()
  624.     WorkOutGrepCommand
  625. End Sub
  626. Private Sub chkCase_Click()
  627.     WorkOutGrepCommand
  628. End Sub
  629. Private Sub chkExact_Click()
  630.     WorkOutGrepCommand
  631. End Sub
  632. Private Sub chkFindFiles_Click()
  633.     If chkFindFiles.Value = 0 Then
  634.         txtFolder.Enabled = False
  635.         cmdBrowseFolders.Enabled = False
  636.         chkRecurseSubFolders.Enabled = False
  637.         lblFilesToFind.Enabled = False
  638.         cboFilesToFind.Enabled = False
  639.         lblFolder.Enabled = False
  640.         lvwInputFiles.Enabled = True
  641.         cmdAddToListView.Enabled = True
  642.         cmdClearListView.Enabled = True
  643.         cmdRemoveFromListView.Enabled = True
  644.         cmdChangeListView.Enabled = True
  645.         cmdFindFiles.Enabled = True
  646.         lblFilesToAnalyse.Enabled = True
  647.     Else
  648.         txtFolder.Enabled = True
  649.         cmdBrowseFolders.Enabled = True
  650.         chkRecurseSubFolders.Enabled = True
  651.         lblFilesToFind.Enabled = True
  652.         cboFilesToFind.Enabled = True
  653.         lblFolder.Enabled = True
  654.         lvwInputFiles.Enabled = False
  655.         cmdAddToListView.Enabled = False
  656.         cmdClearListView.Enabled = False
  657.         cmdRemoveFromListView.Enabled = False
  658.         cmdChangeListView.Enabled = False
  659.         cmdFindFiles.Enabled = False
  660.         lblFilesToAnalyse.Enabled = False
  661.     End If
  662.     WorkOutGrepCommand
  663. End Sub
  664. Private Sub chkInvert_Click()
  665.     WorkOutGrepCommand
  666. End Sub
  667. Private Sub chkLineNumbers_Click()
  668.     WorkOutGrepCommand
  669. End Sub
  670. Private Sub chkOnlyACount_Click()
  671.     If chkOnlyACount.Value = 1 Then
  672.         chkLineNumbers.Enabled = False
  673.         Label3.Enabled = False
  674.         Label4.Enabled = False
  675.         txtPreviousLinesToOutput.Enabled = False
  676.         txtPostLinesToOutput.Enabled = False
  677.         Label5.Enabled = False
  678.     Else
  679.         chkLineNumbers.Enabled = True
  680.         Label3.Enabled = True
  681.         Label4.Enabled = True
  682.         txtPreviousLinesToOutput.Enabled = True
  683.         txtPostLinesToOutput.Enabled = True
  684.         Label5.Enabled = True
  685.     End If
  686.     WorkOutGrepCommand
  687. End Sub
  688. Private Sub chkOutputToFile_Click()
  689.     If chkOutputToFile.Value = 1 Then
  690.         txtOutputFile.Enabled = True
  691.         cmdBrowseOutputFile.Enabled = True
  692.     Else
  693.         txtOutputFile.Enabled = False
  694.         cmdBrowseOutputFile.Enabled = False
  695.     End If
  696. End Sub
  697. Private Sub chkRecurseSubFolders_Click()
  698.     WorkOutGrepCommand
  699. End Sub
  700. Private Sub cmdAddToListView_Click()
  701. Dim i, j As Long
  702. Dim ListItem As ListItem
  703. Dim Path As String
  704. Dim FileName As String
  705. Dim ChkErr As Long
  706.     On Error GoTo ErrHandler:
  707.     cdb1.CancelError = True
  708.     cdb1.DefaultExt = ".txt"
  709.     cdb1.DialogTitle = "Add Files for Grep to search in..."
  710.     cdb1.Filter = "All Files (*.*)|*.*|ASCII Text Files (*.txt)|*.txt|All Text Files (*.txt,*.doc,*.rtf)|*.txt;*.doc;*.rtf|C Files (*.h,*.c)|*.h;*.c|Rich Text Files (*.rtf)|*.rtf|Visual Basic Files (*.bas,*.vbp,*.ctl,*.cls;*.frm,*.pag,*.res)|*.bas,*.vbp,*.ctl,*.cls,*.frm,*.pag,*.res"
  711.     cdb1.FilterIndex = 2
  712.     cdb1.FileName = ""
  713.     cdb1.Flags = cdlOFNAllowMultiselect Or cdlOFNExplorer Or cdlOFNFileMustExist Or cdlOFNHideReadOnly Or cdlOFNLongNames Or cdlOFNPathMustExist
  714.     cdb1.MaxFileSize = 32000
  715.     cdb1.ShowOpen
  716.     If Len(cdb1.FileName) > 1000 Then
  717.         Me.MousePointer = vbArrowHourglass
  718.     End If
  719.     i = InStr(cdb1.FileName, Chr(0))
  720.     If i > 0 Then
  721.         ' multiselect.  Whoever wrote the common dialog control decided that if you'd chosen multi-select
  722.         ' that he'd return it in an odd way.  Specifically, the first "bit" of the string is the path (up to a NULL chr(0) character)
  723.         ' then the filenames are spaced using NULL characters.  Yuk.
  724.         Path = Mid(cdb1.FileName, 1, i - 1)
  725.         j = InStr(i + 1, cdb1.FileName, Chr(0))
  726.         Do While j > 0
  727.             FileName = Path & "\" & Mid(cdb1.FileName, i + 1, j - i - 1)
  728.             On Error Resume Next
  729.             ChkErr = lvwInputFiles.ListItems(FileName).Text ' if error occurs here it is doesn't occur in the list?  Shut up, it works, ok?
  730.             If Err Then
  731.               Err.Clear
  732.               Set ListItem = lvwInputFiles.ListItems.Add(, FileName, FileName)
  733.               ListItem.SubItems(1) = FileLen(FileName)
  734.               ListItem.SubItems(2) = Format(FileDateTime(FileName), "dd/mm/yy")
  735.             End If
  736.             On Error GoTo 0
  737.             i = j
  738.             j = InStr(i + 1, cdb1.FileName, Chr(0))
  739.         Loop
  740.         FileName = Path & "\" & Mid(cdb1.FileName, i + 1)
  741.         On Error Resume Next
  742.         ChkErr = lvwInputFiles.ListItems(FileName).Text ' if error occurs here it is doesn't occur in the list?  Shut up, it works, ok?
  743.         If Err Then
  744.           Err.Clear
  745.           Set ListItem = lvwInputFiles.ListItems.Add(, FileName, FileName)
  746.           ListItem.SubItems(1) = FileLen(FileName)
  747.           ListItem.SubItems(2) = Format(FileDateTime(FileName), "dd/mm/yy")
  748.         End If
  749.         On Error GoTo 0
  750.     Else
  751.         ' single select
  752.         FileName = cdb1.FileName
  753.         On Error Resume Next
  754.         ChkErr = lvwInputFiles.ListItems(FileName).Text ' if error occurs here it is doesn't occur in the list?  Shut up, it works, ok?
  755.         If Err Then
  756.           Err.Clear
  757.           Set ListItem = lvwInputFiles.ListItems.Add(, FileName, FileName)
  758.           ListItem.SubItems(1) = FileLen(FileName)
  759.           ListItem.SubItems(2) = Format(FileDateTime(FileName), "dd/mm/yy")
  760.         End If
  761.         On Error GoTo 0
  762.     End If
  763.     If Len(cdb1.FileName) > 1000 Then
  764.         Me.MousePointer = vbNormal
  765.     End If
  766.     WorkOutGrepCommand
  767.     Exit Sub
  768. ErrHandler:
  769.     If Err.Number = cdlCancel Then
  770.        ' cancel was selected
  771.     Else
  772.         MsgboxForWinGrep Err.Description
  773.     End If
  774.     WorkOutGrepCommand
  775. End Sub
  776. Private Sub cmdBrowseFolders_Click()
  777. Dim strDir As String
  778. #If VBHardCore = True Then
  779.     strDir = BrowseForFolder(Owner:=hWnd, DisplayName:="WinGrep", _
  780.                               Options:=BIF_RETURNONLYFSDIRS, _
  781.                               Title:="Select directory:", _
  782.                               Root:=CSIDL_COMMON_DESKTOPDIRECTORY, _
  783.                               Default:="C:\")
  784. #Else
  785.     strDir = frmChooseDir.GetDirectory
  786.     If Len(strDir) > 0 Then
  787.         txtFolder.Text = strDir
  788.     End If
  789. #End If
  790. End Sub
  791. Private Sub cmdBrowseOutputFile_Click()
  792.     On Error GoTo ErrHandler
  793.     cdb1.CancelError = True
  794.     cdb1.DefaultExt = ".txt"
  795.     cdb1.DialogTitle = "Save Grep Output As..."
  796.     cdb1.FileName = "Output.txt"
  797.     cdb1.Filter = "All Files(*.*)|*.*|Text File(*.txt)|*.txt|Rich Text File (*.rtf)|*.rtf)"
  798.     cdb1.FilterIndex = 2
  799.     cdb1.Flags = cdlOFNExplorer Or cdlOFNLongNames Or cdlOFNHideReadOnly Or cdlOFNOverwritePrompt
  800.     cdb1.ShowSave
  801.     txtOutputFile.Text = cdb1.FileName
  802.     Exit Sub
  803. ErrHandler:
  804.     Exit Sub
  805. End Sub
  806. Private Sub cmdChangeListView_Click()
  807. Dim i, j As Long
  808. Dim ListItem As ListItem
  809. Dim Path As String
  810. Dim FileName As String
  811.     On Error GoTo ErrHandler:
  812.     cdb1.CancelError = True
  813.     cdb1.DefaultExt = ".txt"
  814.     cdb1.DialogTitle = "Add Files for Grep to search in..."
  815.     cdb1.Filter = "All Files (*.*)|*.*|ASCII Text Files (*.txt)|*.txt|All Text Files (*.txt,*.doc,*.rtf)|*.txt;*.doc;*.rtf|C Files (*.h,*.c)|*.h;*.c|Rich Text Files (*.rtf)|*.rtf|Visual Basic Files (*.bas,*.vbp,*.ctl,*.cls;*.frm,*.pag,*.res)|*.bas,*.vbp,*.ctl,*.cls,*.frm,*.pag,*.res"
  816.     cdb1.FilterIndex = 2
  817.     cdb1.FileName = ""
  818.     cdb1.Flags = cdlOFNAllowMultiselect Or cdlOFNExplorer Or cdlOFNFileMustExist Or cdlOFNHideReadOnly Or cdlOFNLongNames Or cdlOFNPathMustExist
  819.     cdb1.MaxFileSize = 32000
  820.     cdb1.ShowOpen
  821.     If Len(cdb1.FileName) > 1000 Then
  822.         Me.MousePointer = vbArrowHourglass
  823.     End If
  824.     lvwInputFiles.ListItems.Clear
  825.     i = InStr(cdb1.FileName, Chr(0))
  826.     If i > 0 Then
  827.         ' multiselect.  Whoever wrote the common dialog control decided that if you'd chosen multi-select
  828.         ' that he'd return it in an odd way.  Specifically, the first "bit" of the string is the path (up to a NULL chr(0) character)
  829.         ' then the filenames are spaced using NULL characters.  Yuk.
  830.         Path = Mid(cdb1.FileName, 1, i - 1)
  831.         j = InStr(i + 1, cdb1.FileName, Chr(0))
  832.         Do While j > 0
  833.             FileName = Path & "\" & Mid(cdb1.FileName, i + 1, j - i - 1)
  834.             Set ListItem = lvwInputFiles.ListItems.Add(, FileName, FileName)
  835.             ListItem.SubItems(1) = FileLen(FileName)
  836.             ListItem.SubItems(2) = Format(FileDateTime(FileName), "dd/mm/yy")
  837.             i = j
  838.             j = InStr(i + 1, cdb1.FileName, Chr(0))
  839.         Loop
  840.         FileName = Path & "\" & Mid(cdb1.FileName, i + 1)
  841.         Set ListItem = lvwInputFiles.ListItems.Add(, FileName, FileName)
  842.         ListItem.SubItems(1) = FileLen(FileName)
  843.         ListItem.SubItems(2) = Format(FileDateTime(FileName), "dd/mm/yy")
  844.     Else
  845.         ' single select
  846.         Set ListItem = lvwInputFiles.ListItems.Add(, cdb1.FileName, cdb1.FileName)
  847.         ListItem.SubItems(1) = FileLen(cdb1.FileName)
  848.         ListItem.SubItems(2) = Format(FileDateTime(cdb1.FileName), "dd/mm/yy")
  849.     End If
  850.     If Len(cdb1.FileName) > 1000 Then
  851.         Me.MousePointer = vbNormal
  852.     End If
  853.     WorkOutGrepCommand
  854.     Exit Sub
  855. ErrHandler:
  856.     If Err.Number = cdlCancel Then
  857.        ' cancel was selected
  858.     Else
  859.         MsgboxForWinGrep Err.Description
  860.     End If
  861.     WorkOutGrepCommand
  862. End Sub
  863. Private Sub cmdClearListView_Click()
  864.     lvwInputFiles.ListItems.Clear
  865.     tbled =  Sub
  866. Private Sub plick()
  867.    r) = FileLen(FileNamevate Sub pliame = Path 
  868.    r) = FileLen(Filok?
  869.   lick()
  870.    r) = FiSath 
  871. \e Sub cmdClear  WorkOutGrepCommand
  872. ETirectory
  873.     If Len(strDir) >>>>>>>>>Dir) >>>>>>>>>Dir) >>>mmand
  874. ks, ok?
  875.             I     _   ' cancel was iU      La  WorkOutGrepCommand
  876. ilme, Fi,
  877.       End
  878.       But+kOutGrepCommand
  879.  WorkOutGrepCommand
  880. End Sub
  881. Private Sub cmdClearListfvates (*.rtf)|*.rtf|Visual Basic F        Xr) >>>>>>>>>Lv|*.bas,   s selected
  882.     Else
  883.        usi)|*.rtf|Visual Basic F        Xr) >>>>>>>>>Lv|*.bas,   s selected
  884.     Elsrivate Sub cmdClearListfvates (*.rtf)s selected
  885. leName)
  886.    ty")
  887.     lected
  888.    ty"dda Hame), "dd/mm/yy")
  889. .bas,   s selected
  890.   selected
  891.     Elsriv
  892.     Elsriv
  893.     Elsriv
  894.     Elsriv
  895. im Path As String
  896. Dim FileName As Strin/ame As Strin/ame As Strin/ameDme)
  897.           ListItem.Sub
  898.     ECan be run f*.rtf|VisstIlglglglglglglg)nrEnabled = lse
  899.        usi)|*.rtf|VisAs String
  900. Dg)nrEnabled = lse
  901.  Chr(0))
  902.  later use"
  903.        stItemi)|*.1.Filter = "All Files (*.*)|*.*|ASCII Text Files|VisAs S
  904.  la"All Files rviles (2FSDIRS, t direct*.*)|*.*|ASCII Text Files|VisAs S
  905.  la"ASor exampisAs S
  906.  la"ASor exampisA"ing
  907. Dg)nsn(FileName)
  908.             ListItem.SubItems(2) = Format(FileDateTime(FileName), "dd/mm/yy")
  909.    r use"
  910.       )nsn)|*.rtf)"
  911.     cdb1.FilterIndeh & Le use"Eoo stItemi)|*.1.Filter = "All  Elsriv
  912. im Path AAAAAAAAAAAAAAAAAAAAAAAAAAAA rvilea
  913. im Path AAAAAAAAAAAnd
  914. End Subme(Fame), "d.e McKinlar  WorkOutGrepCommand2 AAAp    t>AAnd
  915. End Subme(Fame), L sear376
  916.    Directory
  917.   i + 1= True
  918.         txtP = InStr(i + 1, cdb1.Fnd Subm
  919.   i + 1= True
  920. (Fame), L sear3e, cdb1.FileName)
  921.      , L sear376"Add Files for Grep ttttttttttleName)
  922.         ListIteFSDIRSkColor       =   &H00k()
  923. DiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiieNamevate Sub pli  It is si         yPForWinGreps String
  924. Di  &H00k()
  925. Diiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii-Ap    t>AAniles|VisAs S
  926.  la"All Files rviles (2FSDIRS, t Clicf,rviles (2FSDIRS, t Clles (x sAs   stItemi)|*.1.Filti!ub n%22) = Forma(ommand2eplorer Or cdlOsnd2eplorer , t Clles (x285
  927.          Left      earc        Style           =   W n%22) = minding diaemicolons betweep.
  928. ' 8) I've put some commeiItems(FileName).Text Dttribute VB_fa
  929. '[!charli VB_fa
  930. '[!charli VtItems.Add(, FileName
  931.       .Add(, FileName
  932.       .Add(, FileName
  933.      0SNistView 
  934.          Caption       =   1680
  935.          ndex   Ersinghders 
  936.          Caption         = ltems(1) = FileLen(FileName)
  937. Option    Errt Ss (*.i)    ListItect.  Who VtItems.Add(,   Ereiiiiiiii
  938. End Sub
  939. Private Seb
  940.     cdb1"2reiiiiiiii
  941. End k.
  942.  ErrHandler:
  943. tyle     eight          =   2er ,ame = Path & 1)
  944.         Set Lis   eigh) Counting fachosen multi-select
  945.         ' that he'd return it in an odd way.  Specifically, the first "bit" of the string is the path (up to a NULL chr(0) character)
  946.         ' then the filenames are spaced using NULL characters.  Yuk.
  947.         Path = Mid(cdb1.FileNamegd for....
  948. " of the string is the path (tItect.  Who VtItems.Add(,  c
  949. Private Sub chkExact_Click()
  950.     WorkOutGrepCommand
  951. End Sub
  952. Private Sub chkFindFiles_Click()
  953.     If chkFindFiles.Value = 0 Then
  954.         txtFolder.Enabled = False
  955.         cmdBrowseFEa" ListItem.SubItems(2) = Format(FileDateTime(FileNa,mdBU = Path & "\" & Mid& "\" & Mid& "\" & Mid& "\" & Mid& "\" & Mid& "\" & Mid& "\" & Mid& "\" & Mid& "\" & Mid& "\" & Mid& "\" & Mid& "\" & Mid& "\" & Mid& "\" & Mid& "\" & Mid& "\" & Mid& "\" & Mid&      Set ListItem = lvwIncls,*.e)
  956.                             Sub\" ommand
  957. ETirectory
  958.     If Len(2 FileName), "             Sub\" om2 FileName),0      txtFolder.Enablens"
  959.       Height  
  960. Private Sub
  961.   't = lvwIncls,*.e)
  962.                             S*.ctl,*.cls;*.frm,*NULL characterot "bit" of the string is the path (up to a NULL ce                      "Rxist Or cdlOF/Hist Or cdlOF/Histing is thbas,*.v "\" & Mid&   cv "\" & Mid&   c,o VtItems.Add(,   Er*.v "\" &     TabIndex  &   c,o VtItems.Add(, zutGrepCon(2 FileNyyyyyyyyyyyy1Vr*.vEr*.v "\" &     TC7-850A-101B-AFC0-421(lView.Enabled = True
  963. as,OF/Hiiiiiiiiiiiiiiiiiiii    Caption         =   "&Propogate Up"
  964.          Height          =   375
  965.          L
  966.         txtP    375
  967.      iiiiiiii    Caption  e@  Path = Mid(cdb1.FileName, 1    Caption  e@  Path = Midtwithr=3 a NUGrepCommand
  968. ETirectorL_COMMON_DESKTOPDIRECTORY, _
  969.                     .ESKTOPDIRECTORY
  970.          Caption    Sabled = True= Midtwi                 .ESKTOPDIRECTORY
  971.          Captioion    S      LleLen(cdb1.FileName)=       g is thbas,*.v "\"  Len(cdb1.FileName) > 1000 Then
  972. " = FileLen(FileNamec   *.ctl,*.clsShowOpen
  973.     Ife)  Sub
  974. IIIIileDchkFindFiles_Cine rxLdFile1.FileName, Chr(0))
  975.     ListIteFSDIRSkColor       =   &H00kxLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLD0t>>>>Lv|* Sub cLLLLLLLLLLLLLLLLLLLLLLLLLLLLLD0tI)* Sub cLLLLLLLLLLLLLLLLLLLLLLLLLLLLLD0tIoLLLLLLLLLLLim Path As String
  976. DLLLLLLLLLLLLLLLLLLLLLLLLLLcLLLLLLLLLLLLLLLLLLLLn
  977. " = FileLen(FileNamec   *.    cn(FileNamec   *.    cn-oabled = False
  978.  e)=    n(FS
  979.  la"Aing
  980. DLLLLLLLLLLLLLLLLLLLLLLLLLLcLLLLLLLLLLLLLLLLLLLLn
  981.  la"Aing
  982. DLLLLLLLLLLLLLLLLLLLLLLLLLLcLLLLLLLL)nsn(FileNam375
  983.                                       cted
  984. Nocccccy Error Resumees 
  985.          Captionasic F        Xrn an odd way.  Specifically, the first "bit" of the string is the path (up to a NULL chr(0) character)
  986.         ' then the filenames are spaced using NULL characters.  Yuk.
  987.         Path = Mid(cdb1.FileNamegd for....
  988. " of the string is the path (tItect.  Wh  =   &H00kabled = lens"
  989.       Height  
  990. Private Sub
  991.   't = lvwInclbt
  992.       HeihLLL     Mid& Inclbt
  993.       HeihL0kabled = li - 1hLLcLLLLLLLLLLLLLLLLMid& ln Error GoTo 0
  994.     Else
  995.        cLLLLLLLLLLLLLLLLLLLLn
  996.  la"Aing
  997. DLLLLLLLLLL   Wc2l cmdBrowseFEa" ListIteid& "\" & Mid& "nclbt
  998.       
  999.     Elsriv
  1000.     Elsriv
  1001.  txtEa" epCommanis      Height  
  1002. Private Sub
  1003.   't =ivate Sub
  1004.   't     
  1005.     ElsriiGt 't     
  1006.  stView.Enabled = True
  1007.         cmdFindFiles.Enabled = True
  1008.         lblFilesToAnalyse.Enabled = Te any output if matches = bled =   lblFilesToAnalyse.Eles (2F FileLen(Fi
  1009.         Path = Mid(cdb1.File.esTo  txtPreviousLinesToOutput.ErCaption  ULL c   lblFhen
  1010.         tLLLLLLLLLLLLLLLLLLLLLLLLLLLLeth = ser.EDLLLBed = li - 1hLLcLLLLLLLLLLLLLLLLMid& ln Error GoTo 0
  1011.     Else
  1012.        cLLLLLLLLLLLLLLLLLLLLn
  1013.  la"Aing
  1014. DLLLLLLLLLL   Wc2l cmdBrowseFEa" ListIteid& "\" & Mid& "nclbt
  1015.       
  1016.     Elsriv
  1017.     Elsriv
  1018.  txtEa" epCommanis      Height  
  1019. Private Sub
  1020.   't =ivat        tomma-bilth (up to a w Sub
  1021.   't = Elsriv
  1022.  txtEa" epComalyse.Eles (2F FstView.Enabled = True
  1023. ulti-select
  1024.         ' that he'd return it in an odd wCII led = True
  1025.   dBroommand line swd wCILLLLLLeine swd wCILLLLLLine swd wCIEnabled = True
  1026.         lvwInputFiles.EnablLdRemoveFromLisLLLLLLeinabled = ne swd)chkFindFiles_Cine rxLdFileEoid& ln E    nablLdReName)
  1027.    i = iAAAAAAAAA rvilea
  1028. im Path AAAAAAAAAAAnd
  1029. End Subme(Fame), "d.e McKiuRECTORY, _
  1030.                 nU    t>AAn1.File )Eoiecifica   End
  1031.       Begin VB.Comman_
  1032.                 nU       cL m Path AAAAAA.File )Eoiecifica   En_
  1033.     og     =   1695
  1034.       ESBBBBBBBBB ' then the filenames are spaced using NULL characters.  Yukt=cters.  Yukt=cters.  Yukt=cters.  Yukt=cters.  Yukt"Aing
  1035. DLLLLLtring is the iters.  Yukt=ame), "d.e McKinl2reiiiiiiii
  1036. End k.
  1037.  ErrHandler:
  1038. tyle     eight          =   2er ,ame ErrLLLLLLLLthe first "bit" of the string is the path en tho:
  1039. tyle     eight       t =ivat      cL  multiselect.  WAll T   txthen the   nablLdReName)
  1040.    i = iAAAcKirHandlerTitle = "Save Grep Outpu   t =ivat      cL  multiselect.  WAll T   txthem Path As String
  1041. Dim FileName As Strtrtrtrtrtr\ierTikt=cters.  Yukt=cters.    ileNiiiiiiiiiiiiiii
  1042. DLLLLLleNiiiiiiiiiiiiiii
  1043. DLLLLLleNiiiiiiiiiiiiiii
  1044. DLLLLLleNiiiiiiiiiiiiiii
  1045. DLLLLLleNiiiiiiiiiiiiiii
  1046. DLLLLLleNiiiiiiiiiiiiiii
  1047. DLLLLLleNiiiiiiiiiiiiiii
  1048. DLLLLLleNiiiiiiiiiiiiiii
  1049. DLLLLLleNiiiiiiiiiiiiiii
  1050. DLLLLLleNiiiiiiiiiiiiiii
  1051. DLLLLLleNiiiiiiiiiiiiiii
  1052. DLLLiiii
  1053. End kcLLLleNiiiiiiiiiiiiiii
  1054. DLLLLL          Sub\" ommand
  1055. ET(1) = FileLen(FileName)
  1056. RS, iiiiiiiiiiLLleNiiiiii
  1057. DLLLLLleNiiiiiiiiiiiiiii
  1058. DLLLLLleNiiiiiiiiiiiiiii
  1059. DyNiiiiiiiiiiiiiii
  1060. a(ommand2ycivat      cLtxthen the   nablLdREey>yd Subme(Fame),(cdb1.FileName) > 1000 Then
  1061. " = FileLen(FileNamec   *.ctl, & Mid& "\" & Mid& "\leLen(FileNamec   *.ctl if you'd ectory3
  1062. 'For  Format(FileDateTime(cdb1.FileName), "dd/mm/yy")
  1063.     End If
  1064.     If Len(cd  Forup to a NULL chr(ific*.*)|*.*|ASCII Text Fiiiiip to a NULL chr(0) characiiip to a NUUUUUUUUUUUUUUUUUUUUUUUf VBHaro a NUUUUUUUUUUUUUUUUUUUUUUUf VBHaro a NUUUUUUUUUUUUUUUUUUUUUUUt|Rich TLLLLLein/ameDme)
  1065.           ListItem.Sub
  1066.     ECan be runnnnnnnnEUUUUUUUUociiiiiiiiiiii
  1067. DLLLiiii
  1068. End kcLLLleNiiiiiiiii           CoSnLLLSub
  1069. ErrHandler:
  1070.         Path = Mid(cdb1.FNUUUii  idtwi           mChooseDir      Height  
  1071. Pr  "Rxist Or cdles rviles (2FSDIA s (2 Xr)rviles f*.rtf|Viss=-)UUii  idtwi        r)))))))iid(c)))))))iid(c)))))))iid)UUii  idtwi        r)))))))iid(c)))))iiiiii&amec   *.ctl, & Mid& "\" & Midi  p
  1072. DyNiiiiiiiiiiiiiii
  1073.     If Len(cd r)))))))iid(c)o)iiiiii&amec   *.ctl, & Mid&))iid(c)))))))iid)z  FileNan Error LLLLLLn
  1074. "ESBBBBBBBBB ' then theiii
  1075. tEa" epComaaaaaa,ad)z  iSiSiSiSiSiSiSiSiSiSiSiciSiSiSiiiiiiiiiiiihdtIte iW rviles (2FSDIA aaa,ad)z  iSiSiSiSiSiSiSiSiSiSiSiciSiSiSiiiiiiiiiiiihdtIte iW ry)))))i8"ll T   txthen            ListItem.SubItems(1UiSiSiSiSiSiciSiSems(1UiSiSiSiSiSiciSiSems(1SiSiSiSiciSiSems(1SiSiSLLLLLLLLLiciSiSems(1SiSiSiS0 Sems(1UiSiSiSi& Mid&   ccccc()i8"ll T  375
  1076.       End
  1077.   SiSiSiSiciSiSitop    )
  1078.          thbas,*.v "\"  Len(cdbcdb1.FileName, cdb1.Fillllll    = "Add Files for Grepb1.FillllllrA aaa,ad)z  iSiSiS  Len(cdbcdb1.FileName, cdb1.Fillllll    = "Add Fi  mChooseDir  P    cdb1.Fi,Time(        ' that he'd return it in an odd wayaFe'd returnfooseDileNiiiiiiiiiiiiiii
  1079. DXr)rvit "bit" of the string is the path en tho:
  1080. "ESBBBBBBBBB 'LLLLLSiSiSiSiSiciSiSems(1UiSiSiSiSiSiciSiSems(1SiSiSiSiciSiSems(1SiSiSLLLLLLLLLiciSiSems(1SiSiSiS0 Sems(1UiSiSiSi& oiclSiSiSLLL"ms(1SiSitHeight          =   375
  1081.          L
  1082.     Cy)))))i8"llPiiii
  1083. DLLLLLleNiiiiiiiitHeight d
  1084.   SiSiSiSiciSlB 'LLLLLSiSiSiSiSiciSiSem  
  1085.     El1= True
  1086.    0 correct&   ccccc()i8"iSiSiciSlB 'LLLLLSiSiSiSiSiciSiSem  
  1087.     El1= True
  1088.    0 correct&   ccccc()iLLLLLLLiciSiSems(1SiSiSiS0 Sems(1UiSiSiSi& Mid&   ccccc()i8"ll T  375
  1089.       End
  1090.   SiSiSiSiciSiSitop    )
  1091.          thbas,*.v "\"  Len(cdbcdb1.FileName, cdb1.Fillllll    = "Add Files for Grepb1.FillllllrA aaa,ad)z  iSiSiS  Len(cdbcdb1.FileName, cdb1.Fill = "AddSem  
  1092.     El1= True
  1093.    0 correct&   ccccc()(Files i,Etion    S SiS0 Sems(1UiSiSiSi& oLLLLLLLLLLLLLcLLLLLLLL)nsn(Fililes.Endb1.FileLLLLLeth = ser.EDLLLFileName), "             Sub\" om2 FileName),0Grepb1.Fd        ListItem.SubIewmma-bilth (=ame),0Grepb1.Fd        ListItem.SubIewmma-bilth (=ame),0Grs, T  375
  1094.       End
  1095.   SiSxI), "    rr.Number = c> Xr) >>>>>>>>>Lv|*.bas,   s selected
  1096.     Else
  1097.        usi)|*.rt iLD0tIen(Filok?
  1098. im Path As S3        Li_iidIElse
  1099.          ,return it in an odd wayaFe'd returnfooseDileNiiiiiiiiiiiiiii
  1100. )))iG    l> Xr) >>>>>>>>>Lv|*.bUUUUf iiiiiiii
  1101. )))iG    l> Xr(waya   l> Xr(wam Path As nd line swd wCILLLLLLeine swd wCILLLLLLine swd wCIEnabled =       Msgb   End
  1102. stIteid& "\" & Midne swd wCIE"ESBBBBBBBBB ' )swdaraciiip to a        =   1LLLine swd wCIEnabled =       Msgb   End
  1103. stttttttttttttttttttttttttttttttttttttttts selected  End
  1104. std wCILLLLLLeine \"  Len(cdbcdbiiiiiiiiiiiiii
  1105. DLLLLLItt(ALIti
  1106. DLL1=dbcdbiiiiiiiiiiiiii
  1107. DLLLLLii
  1108. DLLLLLii
  1109. DLLLLLii
  1110. DLLLLLii
  1111. DLLLLLiii
  1112.          ii
  1113. DLLLLLtpSiSiiiiiiiiiiiihdtIte iW rvilesAs nd line swd wCILLLLLLeine 'iiiii
  1114. )))iG    l> Xr) >>>>>>>>>Lv|*.bUUUUf iiiiiiii
  1115. )))iG    l> Xr(wa
  1116.