home *** CD-ROM | disk | FTP | other *** search
- VERSION 2.00
- Begin Form question_form
- BackColor = &H00808080&
- Caption = "WAIS Query"
- ClientHeight = 5535
- ClientLeft = -90
- ClientTop = 1470
- ClientWidth = 9540
- Height = 5940
- Icon = QUESTION.FRX:0000
- Left = -150
- LinkMode = 1 'Source
- LinkTopic = "Form1"
- ScaleHeight = 5535
- ScaleWidth = 9540
- Top = 1125
- Width = 9660
- WindowState = 1 'Minimized
- Begin CommandButton view
- Caption = "&View"
- Height = 375
- Left = 120
- TabIndex = 10
- Top = 2790
- Width = 735
- End
- Begin ListBox title
- BackColor = &H00FFFFC0&
- FontBold = 0 'False
- FontItalic = 0 'False
- FontName = "Terminal"
- FontSize = 9
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 3990
- Left = 1200
- TabIndex = 9
- TabStop = 0 'False
- Top = 2430
- Width = 8295
- End
- Begin CommandButton done
- Caption = "Done"
- Height = 375
- Left = 8760
- TabIndex = 12
- Top = 1800
- Width = 735
- End
- Begin CommandButton Command6
- Caption = "&Setup"
- Height = 375
- Left = 7920
- TabIndex = 11
- Top = 1800
- Width = 735
- End
- Begin CommandButton Command1
- Caption = "Help"
- Height = 375
- Left = 6960
- TabIndex = 21
- Top = 1800
- Width = 855
- End
- Begin CommandButton del_doc
- Caption = "&Delete Doc"
- Height = 375
- Left = 5160
- TabIndex = 8
- Top = 1800
- Width = 1215
- End
- Begin CommandButton add_doc
- Caption = "&Add Doc"
- Height = 375
- Left = 3840
- TabIndex = 7
- Top = 1800
- Width = 1215
- End
- Begin CommandButton del_source
- Caption = "Delete Source"
- Height = 375
- Left = 1680
- TabIndex = 5
- Top = 1800
- Width = 1455
- End
- Begin CommandButton add_source
- Caption = "Add Source"
- Height = 375
- Left = 120
- TabIndex = 4
- Top = 1800
- Width = 1455
- End
- Begin ListBox reference
- BackColor = &H00C0FFC0&
- FontBold = 0 'False
- FontItalic = 0 'False
- FontName = "Terminal"
- FontSize = 9
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 750
- Left = 3840
- TabIndex = 6
- TabStop = 0 'False
- Top = 900
- Width = 5655
- End
- Begin ListBox source_list
- BackColor = &H00FFC0FF&
- FontBold = 0 'False
- FontItalic = 0 'False
- FontName = "Terminal"
- FontSize = 9
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 750
- Left = 120
- TabIndex = 3
- TabStop = 0 'False
- Top = 900
- Width = 3615
- End
- Begin CommandButton search
- Caption = "&Search"
- Height = 375
- Left = 8640
- TabIndex = 2
- Top = 360
- Width = 855
- End
- Begin TextBox keywords
- BackColor = &H00FFC0C0&
- FontBold = 0 'False
- FontItalic = 0 'False
- FontName = "Terminal"
- FontSize = 9
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 315
- Left = 120
- TabIndex = 1
- Top = 360
- Width = 8295
- End
- Begin Label stat_line
- BackColor = &H00C0E0FF&
- BorderStyle = 1 'Fixed Single
- FontBold = 0 'False
- FontItalic = 0 'False
- FontName = "Terminal"
- FontSize = 9
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 285
- Left = 840
- TabIndex = 16
- Top = 6480
- Width = 8655
- End
- Begin Label Label6
- BackColor = &H00808080&
- Caption = "Status:"
- Height = 195
- Left = 120
- TabIndex = 17
- Top = 6480
- Width = 615
- End
- Begin Label Label8
- BackColor = &H00808080&
- Caption = "Title"
- Height = 195
- Left = 2640
- TabIndex = 20
- Top = 2250
- Width = 495
- End
- Begin Label Label7
- BackColor = &H00808080&
- Caption = "Size"
- Height = 195
- Left = 2040
- TabIndex = 19
- Top = 2250
- Width = 495
- End
- Begin Label Label5
- BackColor = &H00808080&
- Caption = "Score"
- Height = 195
- Left = 1200
- TabIndex = 18
- Top = 2250
- Width = 615
- End
- Begin Label Label4
- BackColor = &H00808080&
- Caption = "Resulting Documents"
- Height = 375
- Left = 120
- TabIndex = 15
- Top = 2250
- Width = 975
- End
- Begin Label Label2
- BackColor = &H00808080&
- Caption = "Similar to:"
- Height = 165
- Left = 3840
- TabIndex = 13
- Top = 720
- Width = 975
- End
- Begin Label Label3
- BackColor = &H00808080&
- Caption = "In sources:"
- Height = 165
- Left = 120
- TabIndex = 14
- Top = 720
- Width = 1575
- End
- Begin Label Label1
- BackColor = &H00808080&
- Caption = "Tell me about:"
- Height = 165
- Left = 120
- TabIndex = 0
- Top = 90
- Width = 1455
- End
- Sub add_doc_Click ()
- If title.listindex = -1 Then
- MsgBox ("Please highlight a reference for comparison")
- Exit Sub
- End If
- ref_doc_size(reference.listcount) = title_doc_size(title.listindex)
- ref_doc_bytes(reference.listcount) = title_doc_bytes(title.listindex)
- ref_type(reference.listcount) = title_type(title.listindex)
- ref_start(reference.listcount) = -1
- ref_end(reference.listcount) = -1
- reference.AddItem Right$(title.text, Len(title.text) - 11)
- End Sub
- Sub add_source_Click ()
- mousepointer = HOURGLASS
- sources_form.Show
- mousepointer = DEFAULT
- End Sub
-
- Sub Command1_Click ()
- Open "wais.hlp" For Input As 4
- Do Until EOF(4)
- Line Input #4, lines$
- res$ = res$ + lines$ + Chr$(13) + Chr$(10)
- Loop
- Form3.Text1.text = res$
- Form3.Show
- Close (4)
- End Sub
- Sub Command6_Click ()
- Form1.Show 1
- End Sub
- Sub del_doc_Click ()
- Dim x As Integer
- If reference.listindex > -1 Then
-
- For x = reference.listindex To reference.listcount
- ref_doc_size(x) = ref_doc_size(x + 1)
- ref_doc_bytes(x) = ref_doc_bytes(x + 1)
- Next x
-
- reference.RemoveItem reference.listindex
- Else
- MsgBox ("You haven't selected a reference to delete")
- End If
- End Sub
- Sub del_source_Click ()
- Dim x As Integer
- If source_list.listindex > -1 Then
-
- For x = source_list.listindex To source_list.listcount
- src_port(x) = src_port(x + 1)
- src_service(x) = src_service(x + 1)
- src_database(x) = src_database(x + 1)
- Next x
-
- source_list.RemoveItem source_list.listindex
- Else
- MsgBox ("You haven't selected a source to delete")
- End If
- End Sub
- Sub Done_Click ()
- If sources_loaded Then
- Close
- Open "wais.src" For Output As 3
- src = sources_form.s_source_list.listcount - 1
- For x = 0 To src
- slist$ = s_database(x) + Str$(s_port(x)) + " " + s_service(x) + " " + sources_form.s_source_list.list(x)
- Print #3, slist$
- Next x
-
- Close (3)
- End If
- Kill "wais.$$$"
- End
- End Sub
- Sub Form_Load ()
- Open "wais.$$$" For Output As 1
- Close (1)
- max_docs% = 100
- windowstate = 2
- mousepointer = DEFAULT
- Form1.Text2.text = "100"
- End Sub
- Sub map_Click ()
- mousepointer = HOURGLASS
- mousepointer = DEFAULT
- End Sub
- Sub search_Click ()
- Dim func As Integer
- Dim stat As Integer
- Dim docno As Integer
- Dim refno As Integer
- Dim tot_ref As Integer
- Dim headline As DOC
- Dim refid As REF
- If source_list.listcount = 0 Then
- MsgBox ("You must select at least one source")
- Exit Sub
- End If
- mousepointer = HOURGLASS
- tot_ref = reference.listcount
-
- If tot_ref > 0 Then
-
- For refno = 0 To tot_ref - 1
- refid.ch_start = ref_start(refno) - 1
- refid.ch_end = ref_end(refno)
- refid.doc_size = ref_doc_size(refno)
- refid.type = ref_type(refno)
- refid.doc_bytes = ref_doc_bytes(refno)
- stat = reference_titles(refno, tot_ref, refid)
- Next refno
- End If
- func = 0
- For x = 0 To source_list.listcount - 1
-
- If x > 0 Then
- func = 1
- End If
- If x = source_list.listcount - 1 Then
- func = 2
- End If
-
- kw$ = keywords.text
- If Len(kw$) = 0 Then
- kw$ = " "
- End If
- stat_line.caption = " Connecting to service " + src_service(x) + ", database " + src_database(x)
-
- z = DoEvents()
- stat = query_titles(func, tot_ref, src_service(x), src_database(x), kw$, src_port(x))
- test_for_error stat, 0
- Next x
- If title.listcount > 0 Then
- For x = 0 To title.listcount - 1
- title.RemoveItem 0
- Next x
- End If
- stat = 0
- docno = 0
- While stat = 0 And docno < max_docs
-
- stat = get_titles(docno, headline)
-
- test_for_error stat, docno
- If stat = 0 Or stat = 1 Then
- title_doc_size(docno) = headline.doc_size
- title_doc_bytes(docno) = Left$(headline.doc_bytes, headline.doc_size)
- title_type(docno) = headline.type
-
- tscore$ = Format$(headline.score, "###0")
- tscore$ = Space$(4 - Len(tscore$)) + tscore$
- tlength$ = Format$(headline.length / 1000, "###.0K")
- tlength$ = Space$(7 - Len(tlength$)) + tlength$
- msg$ = tscore$ + tlength$ + " " + RTrim$(headline.title)
- title.AddItem msg$
- docno = docno + 1
- End If
- Wend
- mousepointer = DEFAULT
- End Sub
- Sub test_for_error (stat As Integer, docno As Integer)
-
- Select Case stat
- Case 0
- Exit Sub
- Case 1
- stat_line.caption = " Found" + Str$(docno + 1) + " references"
- Case 2
- stat_line.caption = " Error 2"
- Case 3
- stat_line.caption = " Error 3"
- Case 4
- stat_line.caption = " Error 4"
- Case 5
- stat_line.caption = " Error 5"
- Case 6
- stat_line.caption = " Premature end of text"
- stat = 0
- Case 7
- stat_line.caption = " Error 7"
- Case 8
- stat_line.caption = " No matching references found"
- Case Else
- stat_line.caption = " Unknown error" + Str$(stat)
- End Select
- z = DoEvents()
- End Sub
- Sub title_DblClick ()
- Dim docno As Integer
- Dim doc_lines As Integer
- Dim stat As Integer
- Dim rec As String * 80
- mousepointer = HOURGLASS
- stat_line.caption = " Getting document from server..."
- docno = title.listindex
- stat = get_document(docno, title_type(docno))
- test_for_error stat, docno
- If stat = 0 Then
- If InStr(title_type(docno), "GIF") Then
- i = Shell("wingif.exe wais.$$$", 1)
- ElseIf InStr(title_type(docno), "TEXT") Then
- view_form.Show 1
- ElseIf InStr(title_type(docno), "WSRC") Then
- view_form.Show 1
- Else
- save_form.Show 1
- End If
- End If
- stat_line.caption = ""
- mousepointer = DEFAULT
- End Sub
- Sub view_Click ()
- If title.listindex = -1 Then
- MsgBox ("Please select a title to view")
- Exit Sub
- End If
- title_DblClick
- End Sub
-