home *** CD-ROM | disk | FTP | other *** search
/ Chip Hitware 3 (Alt) / Chip_Hitware_Vol_03.iso / chiphit3 / win95 / tool / zipserv / search.fr_ / search.fr (.txt)
Encoding:
Visual Basic Form  |  1995-09-23  |  5.5 KB  |  161 lines

  1. VERSION 2.00
  2. Begin Form Form1 
  3.    BackColor       =   &H00C0C0C0&
  4.    Caption         =   "ZipServer Fast File Search Demo"
  5.    ClientHeight    =   6216
  6.    ClientLeft      =   912
  7.    ClientTop       =   1620
  8.    ClientWidth     =   6420
  9.    Height          =   6636
  10.    Icon            =   SEARCH.FRX:0000
  11.    Left            =   864
  12.    LinkTopic       =   "Form1"
  13.    ScaleHeight     =   6216
  14.    ScaleWidth      =   6420
  15.    Top             =   1248
  16.    Width           =   6516
  17.    Begin CommandButton Command3 
  18.       Caption         =   "&Print"
  19.       Enabled         =   0   'False
  20.       Height          =   396
  21.       Left            =   204
  22.       TabIndex        =   7
  23.       Top             =   2316
  24.       Width           =   972
  25.    End
  26.    Begin PictureBox Picture1 
  27.       BackColor       =   &H00C0C0C0&
  28.       BorderStyle     =   0  'None
  29.       Height          =   396
  30.       Left            =   1140
  31.       Picture         =   SEARCH.FRX:0302
  32.       ScaleHeight     =   396
  33.       ScaleWidth      =   624
  34.       TabIndex        =   5
  35.       Top             =   1536
  36.       Width           =   624
  37.    End
  38.    Begin CommandButton Command2 
  39.       Caption         =   "&Info"
  40.       Height          =   396
  41.       Left            =   96
  42.       TabIndex        =   4
  43.       Top             =   1560
  44.       Width           =   972
  45.    End
  46.    Begin ListBox List1 
  47.       Height          =   3096
  48.       Left            =   168
  49.       TabIndex        =   2
  50.       Top             =   3036
  51.       Visible         =   0   'False
  52.       Width           =   6096
  53.    End
  54.    Begin TextBox Text1 
  55.       Height          =   396
  56.       Left            =   3120
  57.       TabIndex        =   1
  58.       Text            =   " "
  59.       Top             =   1536
  60.       Width           =   3144
  61.    End
  62.    Begin CommandButton Command1 
  63.       Caption         =   "&Search"
  64.       Default         =   -1  'True
  65.       Height          =   396
  66.       Left            =   2016
  67.       TabIndex        =   0
  68.       Top             =   1536
  69.       Width           =   972
  70.    End
  71.    Begin Label Label2 
  72.       Alignment       =   2  'Center
  73.       BackStyle       =   0  'Transparent
  74.       Caption         =   "Example: Find all files in and under the WINDOWS directory, that's second character is 'B' and the file extension is 'DLL'.  Type in the text box: C:\WINDOWS\?B*.DLL"
  75.       Height          =   948
  76.       Left            =   3084
  77.       TabIndex        =   6
  78.       Top             =   1944
  79.       Width           =   3240
  80.    End
  81.    Begin Label Label1 
  82.       Alignment       =   2  'Center
  83.       BorderStyle     =   1  'Fixed Single
  84.       Caption         =   "This program demonstrates ZipServer's fast file search routines provided by calls to the ZipServ.DLL. The Visual Basic source code is included in the ZipServer Development Kit. In order to obtain a trial version of the Development Kit download first the ZipServer from Compuserve and than contact Redei Enterprises by E-Mail (71744,3633). The development kit includes functions for Zipping and Unzipping, multivolume archiving from your own code. Click 'Info' to learn more about ordering and products."
  85.       ForeColor       =   &H00FF0000&
  86.       Height          =   1416
  87.       Left            =   84
  88.       TabIndex        =   3
  89.       Top             =   36
  90.       Width           =   6252
  91.    End
  92. Sub Command1_Click ()
  93.     Dim found%, i%
  94.     List1.Clear
  95.     List1.Visible = False
  96.     Mousepointer = 11
  97.     If Text1 > "" Then
  98.        found% = SearchFor(Text1, True, True)
  99.        If found% > 0 Then
  100.           For i% = 1 To found%
  101.               List1.AddItem FoundInSearch(i%)
  102.           Next
  103.        End If
  104.     End If
  105.     Mousepointer = 0
  106.     List1.Visible = True
  107.     If List1.ListCount > 0 Then
  108.        Command3.Enabled = True
  109.     Else
  110.        Command3.Enabled = False
  111.     End If
  112. End Sub
  113. Sub Command2_Click ()
  114.     Dim y As Integer, Orders   As String
  115.     Orders = App.Path
  116.     If Right$(App.Path, 1) <> "\" Then
  117.        Orders = Orders + "\"
  118.     End If
  119.     Orders = Orders + "ORDER.WRI"
  120.     y = Shell("Write " + Orders, 1)
  121. End Sub
  122. Sub Command3_Click ()
  123.     Dim a$, w%, i%
  124.     a$ = InputBox$("Please enter the name and path of the text file for the report", "Print Search Report")
  125.     If a$ > "" Then
  126.        p$ = ExtractPath(a$)
  127.        If Len(p$) > 3 And Right$(p$, 1) = "\" Then
  128.           p$ = Left$(p$, Len(p$) - 1)
  129.        End If
  130.        If Dir$(p$, 16) > "" Then
  131.           If ExtractBase(a$) > "" Then
  132.              File$ = ExtractFile(a$)
  133.              If InStr(File$, ".") = 0 Then
  134.                 File$ = File$ + ".TXT"
  135.              ElseIf Not InStr(File$, ".") = 0 And Len(File$) = InStr(File$, ".") Then
  136.                 File$ = File$ + "TXT"
  137.              End If
  138.              File$ = ExtractPath(a$) + File$
  139.              w = FreeFile
  140.              Open File$ For Output As #w
  141.              Print #w, "Search request: " + Text1
  142.              Print #w, "Found : " + Trim(Str$(List1.ListCount)) + " files"
  143.              Print #w,
  144.              For i = 0 To List1.ListCount - 1
  145.                  Print #w, List1.List(i)
  146.              Next
  147.              Print #w,
  148.              Print #w, "Searched by ZipServer from Redei Enterprises (310)832-6984"
  149.              Close #w
  150.           Else
  151.              MsgBox "File name was not entered", 48, "ZipServer"
  152.           End If
  153.        Else
  154.           MsgBox "Directory: " + Chr$(34) + p$ + Chr$(34) + " not found.", 48, "ZipServer"
  155.        End If
  156.     End If
  157. End Sub
  158. Sub Form_Load ()
  159.     Move (Screen.Width - Width) / 2, (Screen.Height - Height) / 2
  160. End Sub
  161.