home *** CD-ROM | disk | FTP | other *** search
- VERSION 2.00
- Begin Form question_form
- BackColor = &H00C0C0C0&
- Caption = "WAIS Query"
- ClientHeight = 4875
- ClientLeft = 15
- ClientTop = 1440
- ClientWidth = 9465
- Height = 5565
- Icon = QUESTION.FRX:0000
- Left = -45
- LinkMode = 1 'Source
- LinkTopic = "Form1"
- ScaleHeight = 4875
- ScaleWidth = 9465
- Top = 810
- Width = 9585
- Begin SSPanel button_bar
- Align = 1 'Align Top
- Alignment = 0 'Left Justify - TOP
- BackColor = &H00808080&
- BevelOuter = 1 'Inset
- Font3D = 1 'Raised w/light shading
- ForeColor = &H00000000&
- Height = 495
- Left = 0
- Outline = -1 'True
- TabIndex = 23
- Top = 0
- Width = 9465
- Begin SSCommand slipdial_bbox
- AutoSize = 2 'Adjust Button Size To Picture
- BevelWidth = 1
- Font3D = 0 'None
- Height = 420
- Left = 2340
- Picture = QUESTION.FRX:073A
- TabIndex = 4
- Top = 30
- Width = 450
- End
- Begin SSCommand map_bbox
- AutoSize = 2 'Adjust Button Size To Picture
- BevelWidth = 1
- Font3D = 0 'None
- Height = 420
- Left = 1770
- Picture = QUESTION.FRX:08BC
- TabIndex = 3
- Top = 30
- Width = 450
- End
- Begin SSCommand aids_clear_bbox
- AutoSize = 2 'Adjust Button Size To Picture
- BevelWidth = 1
- Font3D = 0 'None
- Height = 420
- Left = 1170
- Picture = QUESTION.FRX:0A3E
- TabIndex = 2
- Top = 30
- Width = 450
- End
- Begin SSCommand max_displays_bbox
- AutoSize = 2 'Adjust Button Size To Picture
- BevelWidth = 1
- Font3D = 0 'None
- Height = 420
- Left = 750
- Picture = QUESTION.FRX:0BC0
- TabIndex = 1
- Top = 30
- Width = 450
- End
- Begin SSCommand add_source_bbox
- AutoSize = 2 'Adjust Button Size To Picture
- BevelWidth = 1
- Font3D = 0 'None
- Height = 420
- Left = 150
- Picture = QUESTION.FRX:0D42
- TabIndex = 0
- Top = 30
- Width = 450
- End
- End
- Begin SSPanel results_box
- Align = 1 'Align Top
- Alignment = 3 'Right Justify - TOP
- BackColor = &H00C0C0C0&
- Caption = "Resulting Documents "
- Font3D = 0 'None
- ForeColor = &H00000000&
- Height = 2145
- Left = 0
- TabIndex = 14
- Top = 2760
- Width = 9465
- Begin SSPanel status_label
- BackColor = &H00C0C0C0&
- BevelOuter = 1 'Inset
- Caption = "Status"
- Font3D = 0 'None
- ForeColor = &H00000000&
- Height = 495
- Left = 60
- TabIndex = 22
- Top = 1590
- Width = 675
- End
- Begin SSPanel status_box
- Alignment = 3 'Right Justify - TOP
- BackColor = &H00C0C0C0&
- BevelOuter = 1 'Inset
- Font3D = 1 'Raised w/light shading
- ForeColor = &H00000000&
- Height = 495
- Left = 750
- TabIndex = 20
- Top = 1590
- Width = 8715
- Begin ListBox status_list
- BackColor = &H00FFFFFF&
- Height = 420
- Left = 30
- TabIndex = 21
- Top = 30
- Width = 8655
- End
- End
- Begin SSPanel title_box
- Alignment = 3 'Right Justify - TOP
- BackColor = &H00C0C0C0&
- BevelOuter = 1 'Inset
- Font3D = 1 'Raised w/light shading
- ForeColor = &H00000000&
- Height = 1005
- Left = 90
- TabIndex = 19
- Top = 510
- Width = 9405
- Begin ListBox title
- BackColor = &H00FFFFFF&
- DragIcon = QUESTION.FRX:0EC4
- FontBold = 0 'False
- FontItalic = 0 'False
- FontName = "Terminal"
- FontSize = 9
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 570
- Left = 30
- TabIndex = 10
- Tag = "TITLE"
- Top = 30
- Width = 9345
- End
- End
- Begin SSPanel title_label
- Alignment = 1 'Left Justify - MIDDLE
- BackColor = &H00C0C0C0&
- BevelOuter = 1 'Inset
- Caption = "Title"
- Font3D = 0 'None
- ForeColor = &H00000000&
- Height = 255
- Left = 2190
- TabIndex = 18
- Top = 240
- Width = 7275
- End
- Begin SSPanel Panel3D8
- BackColor = &H00C0C0C0&
- BevelOuter = 1 'Inset
- Caption = "Src"
- Font3D = 0 'None
- ForeColor = &H00000000&
- Height = 255
- Left = 1530
- TabIndex = 17
- Top = 240
- Width = 615
- End
- Begin SSPanel Panel3D7
- BackColor = &H00C0C0C0&
- BevelOuter = 1 'Inset
- Caption = "Size"
- Font3D = 0 'None
- ForeColor = &H00000000&
- Height = 255
- Left = 750
- TabIndex = 16
- Top = 240
- Width = 735
- End
- Begin SSPanel Panel3D6
- Alignment = 1 'Left Justify - MIDDLE
- BackColor = &H00C0C0C0&
- BevelOuter = 1 'Inset
- Caption = "Score"
- Font3D = 0 'None
- ForeColor = &H00000000&
- Height = 255
- Left = 60
- TabIndex = 15
- Top = 240
- Width = 645
- End
- End
- Begin SSPanel reference_frame
- Align = 1 'Align Top
- Alignment = 0 'Left Justify - TOP
- BackColor = &H00C0C0C0&
- Caption = "Similar to:"
- Font3D = 0 'None
- ForeColor = &H00000000&
- Height = 1380
- Left = 0
- TabIndex = 12
- Top = 1380
- Width = 9465
- Begin CommandButton add_doc
- Caption = "&Add Doc"
- Height = 375
- Left = 8370
- TabIndex = 8
- Top = 270
- Width = 1065
- End
- Begin CommandButton del_doc
- Caption = "&Delete Doc"
- Height = 375
- Left = 8370
- TabIndex = 9
- Top = 810
- Width = 1065
- End
- Begin SSPanel reference_box
- Alignment = 0 'Left Justify - TOP
- BackColor = &H00C0C0C0&
- BevelOuter = 1 'Inset
- Font3D = 1 'Raised w/light shading
- ForeColor = &H00000000&
- Height = 1005
- Left = 60
- TabIndex = 13
- Top = 240
- Width = 8265
- Begin ListBox reference
- BackColor = &H00FFFFFF&
- DragIcon = QUESTION.FRX:11C6
- FontBold = 0 'False
- FontItalic = 0 'False
- FontName = "Terminal"
- FontSize = 9
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 570
- Left = 30
- TabIndex = 7
- Tag = "REF"
- Top = 30
- Width = 8175
- End
- End
- End
- Begin SSPanel Panel3D1
- Align = 1 'Align Top
- Alignment = 0 'Left Justify - TOP
- BackColor = &H00C0C0C0&
- Caption = "Tell me about:"
- Font3D = 0 'None
- ForeColor = &H00000000&
- Height = 885
- Left = 0
- TabIndex = 5
- Top = 495
- Width = 9465
- Begin SSCommand search
- BevelWidth = 1
- Font3D = 0 'None
- Height = 495
- Left = 8370
- Picture = QUESTION.FRX:14C8
- TabIndex = 24
- Top = 240
- Width = 1065
- End
- Begin SSPanel keywords_box
- Alignment = 0 'Left Justify - TOP
- BackColor = &H00C0C0C0&
- BevelOuter = 1 'Inset
- Font3D = 1 'Raised w/light shading
- ForeColor = &H00000000&
- Height = 585
- Left = 60
- TabIndex = 11
- Top = 210
- Width = 8265
- Begin TextBox keywords
- BackColor = &H00FFFFFF&
- FontBold = 0 'False
- FontItalic = 0 'False
- FontName = "Terminal"
- FontSize = 9
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 495
- Left = 30
- MultiLine = -1 'True
- ScrollBars = 2 'Vertical
- TabIndex = 6
- Top = 30
- Width = 8175
- End
- End
- End
- Begin CommonDialog file_dialog
- Left = 4080
- Top = 1920
- End
- Begin Menu file_menu
- Caption = "&File"
- Begin Menu add_source_menu
- Caption = "&Select Sources"
- End
- Begin Menu s1
- Caption = "-"
- End
- Begin Menu exit_menu
- Caption = "E&xit"
- End
- End
- Begin Menu setup_menu
- Caption = "&Setup"
- Begin Menu hide_buttons
- Caption = "&Hide Buttons"
- Checked = -1 'True
- End
- Begin Menu max_displays
- Caption = "&Maximize Displays"
- Checked = -1 'True
- End
- Begin Menu menu_setup_globe
- Caption = "Show Globe on Map"
- Checked = -1 'True
- Enabled = 0 'False
- Visible = 0 'False
- End
- Begin Menu menu_setup_grid
- Caption = "Show Grid on Map"
- Checked = -1 'True
- Enabled = 0 'False
- Visible = 0 'False
- End
- Begin Menu s2
- Caption = "-"
- End
- Begin Menu edit_src_menu
- Caption = "&Sources"
- End
- Begin Menu s5
- Caption = "-"
- End
- Begin Menu max_docs_menu
- Caption = "&Max Documents"
- End
- Begin Menu link_edit_menu
- Caption = "&Link Names"
- End
- Begin Menu filter_menu
- Caption = "&Filters"
- End
- End
- Begin Menu aids_menu
- Caption = "&Aids"
- Begin Menu aids_clear_menu
- Caption = "&Clear"
- End
- Begin Menu x1
- Caption = "-"
- End
- Begin Menu slip_dial
- Caption = "&SLIP Dial"
- End
- Begin Menu map_menu
- Caption = "&Map"
- End
- End
- Begin Menu help_menu
- Caption = "&Help"
- Begin Menu using_menu
- Caption = "&Using WAIS"
- End
- Begin Menu s4
- Caption = "-"
- End
- Begin Menu about_menu
- Caption = "&About WAIS"
- End
- End
- Sub about_menu_Click ()
- about_form.Show 1
- Unload about_form
- End Sub
- Sub add_doc_click ()
- Dim DocID As REF
- If title.ListIndex = -1 Then
- MsgBox "Please highlight a reference for comparison", MB_INFO
- Exit Sub
- End If
- z = get_docid(title.ListIndex, DocID)
- ref_doc_size(reference.ListCount) = DocID.doc_size
- ref_doc_bytes(reference.ListCount) = Left$(DocID.doc_bytes, DocID.doc_size)
- ref_type(reference.ListCount) = DocID.type
- ref_start(reference.ListCount) = -1
- ref_end(reference.ListCount) = -1
- reference.AddItem Right$(title.Text, Len(title.Text) - 11)
- End Sub
- Sub add_source_bbox_Click ()
- ' If Not Value Then
- ' Exit Sub
- ' End If
- add_source_menu_click
- ' add_source_bbox.Value = False
- End Sub
- Sub add_source_menu_click ()
- mousepointer = HOURGLASS
- sources_form.Show
- mousepointer = DEFAULT
- End Sub
- Sub aids_clear_bbox_Click ()
- aids_clear_menu_click
- End Sub
- Sub aids_clear_menu_click ()
- keywords.Text = ""
- If reference.ListCount > 0 Then
- For X = 1 To reference.ListCount
- reference.RemoveItem 0
- Next X
- End If
- 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", MB_INFO
- End If
- End Sub
- Sub edit_src_menu_Click ()
- new_src_form.Show 1
- Unload new_src_form
- End Sub
- Sub exit_menu_Click ()
- If Not MsgBox("Are you sure you want to exit from WAIS?", MB_WARN Or 1) = 1 Then
- Exit Sub
- End If
- final_exit
- End Sub
- Sub filter_menu_Click ()
- filters_form.Show 1
- Unload filters_form
- End Sub
- Sub final_exit ()
- Close
- save_source_group
- On Error Resume Next
- Kill temp_path + "\WAIS.$$$"
- For X = 0 To MAX_TEMP_FILES - 1
- If file_list(X) <> "" Then
- fn$ = temp_path + "\WAIS" + Format$(X, "0000") + "." + file_list(X)
- Kill fn$
- End If
- Next X
- z = PutINIString("Settings", "HideButtons", Str$(hide_buttons.Checked), "wais.ini")
- z = PutINIString("Settings", "MaxDocs", Str$(max_docs), "wais.ini")
- z = PutINIString("Settings", "MaxDisplays", Str$(max_displays.Checked), "wais.ini")
- ' z = PutINIString("Settings", "WinSock", Str$(winsock_menu.Checked), "wais.ini")
- z = PutINIString("Settings", "SrcGroup", current_group, "wais.ini")
- End
- End Sub
- Sub Form_Activate ()
- hide_buttons.Checked = Not hide_buttons.Checked
- hide_buttons_click
- End Sub
- Sub Form_DragDrop (Source As Control, X As Single, Y As Single)
- If Source.Tag = "REF" Then
- del_doc_click
- End If
- End Sub
- Sub Form_Load ()
- Dim wais_handle As Integer
- Dim ln As String * 80
- wais_handle = GetModuleHandle("wais")
- If GetModuleUsage(wais_handle) > 0 Then
- z = MsgBox("Another copy of WAIS is already running", MB_WARN)
- End
- End If
- temp_path = Environ$("TEMP")
- If temp_path = "" Then
- temp_path = Environ$("TMP")
- End If
- If Right$(temp_path, 1) = "\" Then
- temp_path = Left$(temp_path, Len(temp_path) - 1)
- End If
- tmpfile$ = temp_path + "\WAIS00*.*"
- fn$ = Dir$(tmpfile$)
- While fn$ <> ""
- Kill temp_path + "\" + fn$
- fn$ = Dir$
- Wend
- 'db_path = Command$
- 'If db_path = "" Then
- ' db_path = Environ$("WAISDB")
- 'End If
- z = set_path(db_path, temp_path)
- 'log_status "Using '" + db_path + "' for local databases"
- log_status "Using '" + temp_path + "' for work files"
- max_docs = GetINIInt("Settings", "MaxDocs", 75, "wais.ini")
- maxdocs_form.num_docs.Caption = Str$(max_docs)
- z = set_maxdocs(max_docs)
- max_displays.Checked = GetINIInt("Settings", "MaxDisplays", True, "wais.ini")
- If max_displays.Checked Then
- windowstate = MAXIMIZED
- Refresh
- End If
- hide_buttons.Checked = GetINIInt("Settings", "HideButtons", False, "wais.ini")
- lnsz = GetINIString("Settings", "SrcGroup", "", ln, 80, "wais.ini")
- If lnsz = 0 Then
- current_group = "WAIS"
- Else
- current_group = Trim$(Left$(ln, lnsz))
- End If
- load_group_list sources_form, READONLY
- load_source_group
- coprocessor = coprocessor_status()
- file_dialog.CancelError = True
- file_dialog.DefaultExt = "doc"
- file_dialog.Filename = "*.doc"
- file_dialog.Filter = "Document (*.doc)|*.doc|Text file (*.txt)|*.txt|Print files (*.prt)|*.prt|All files (*.*)|*.*|"
- file_dialog.FilterIndex = 1
- file_dialog.Flags = OFN_PATHMUSTEXIST Or OFN_HIDEREADONLY Or OFN_OVERWRITEPROMPT
- For X = 0 To 9
- fn$ = "Filter" + Trim$(Str$(X + 1))
- lnsz = GetINIString("Filters", fn$, "", ln, 80, "wais.ini")
- If lnsz > 0 Then
- filter_type_code(X) = UCase$(RTrim$(Left$(ln, 4)))
- filter_ext(X) = UCase$(RTrim$(Mid$(ln, 6, 3)))
- filter_name(X) = UCase$(RTrim$(Mid$(ln, 10, lnsz - 9)))
- End If
- Next X
- mousecursor = DEFAULT
- End Sub
- Sub form_resize ()
- If windowstate = MINIMIZED Then
- Exit Sub
- End If
- If question_form.Height < 5000 Then
- question_form.Height = 5000
- End If
- If question_form.Width < 4000 Then
- question_form.Width = 4000
- End If
- search.Left = question_form.Width - (search.Width + 200)
- add_doc.Left = search.Left
- del_doc.Left = search.Left
- keywords.Width = search.Left - 200
- keywords_box.Width = keywords.Width + 80
- reference.Width = search.Left - 200
- reference_box.Width = reference.Width + 80
- reference.Height = reference_box.Height - 40
- results_box.Height = question_form.Height - keywords_box.Height - reference_box.Height - button_bar.Height
- title.Width = results_box.Width - 200
- title_box.Width = title.Width + 80
- title.Height = results_box.Height - 2500
- title_box.Height = title.Height + 80
- title_label.Width = title.Width - 2050
- status_label.Top = title_box.Top + title_box.Height + 50
- status_box.Top = status_label.Top
- status_box.Width = title_box.Width - 695
- status_list.Width = status_box.Width - 70
- End Sub
- Sub Form_Unload (Cancel As Integer)
- If Not MsgBox("Are you sure you want to exit from WAIS?", MB_WARN Or 1) = 1 Then
- Cancel = 1
- Exit Sub
- End If
- final_exit
- End Sub
- Sub hide_buttons_click ()
- If hide_buttons.Checked = False Then
- hide_buttons.Checked = True
- add_doc.Visible = False
- add_doc.Enabled = False
- del_doc.Visible = False
- del_doc.Enabled = False
- reference_box.Width = title_box.Width
- reference.Width = title.Width
- Else
- hide_buttons.Checked = False
- add_doc.Visible = True
- add_doc.Enabled = True
- del_doc.Visible = True
- del_doc.Enabled = True
- reference_box.Width = keywords_box.Width
- reference.Width = keywords.Width
- End If
- End Sub
- Sub keywords_DragDrop (Source As Control, X As Single, Y As Single)
- If Source.Tag = "REF" Then
- del_doc_click
- End If
- End Sub
- Sub keywords_KeyPress (KeyAscii As Integer)
- If KeyAscii = 13 Then
- search.Value = True
- KeyAscii = 0
- End If
- End Sub
- Sub link_edit_menu_Click ()
- link_edit_form.Show 1
- Unload link_edit_form
- End Sub
- Sub log_status (status_message As String)
- If status_list.ListCount > 19 Then
- status_list.RemoveItem 19
- End If
- status_list.AddItem status_message, 0
- status_list.ListIndex = 0
- status_list.Refresh
- End Sub
- Sub map_bbox_Click ()
- map_menu_click
- End Sub
- Sub map_menu_click ()
- map_form.Show 1
- Unload map_form
- End Sub
- Sub max_displays_bbox_Click ()
- max_displays_click
- End Sub
- Sub max_displays_click ()
- If max_displays.Checked Then
- max_displays.Checked = False
- windowstate = DEFAULT
- Else
- max_displays.Checked = True
- windowstate = MAXIMIZED
- End If
- End Sub
- Sub max_docs_menu_Click ()
- maxdocs_form.Show 1
- Unload maxdocs_form
- End Sub
- Sub menu_setup_globe_Click ()
- If menu_setup_globe.Checked Then
- menu_setup_globe.Checked = False
- Else
- menu_setup_globe.Checked = True
- End If
- End Sub
- Sub menu_setup_grid_Click ()
- If menu_setup_grid.Checked Then
- menu_setup_grid.Checked = False
- Else
- menu_setup_grid.Checked = True
- End If
- End Sub
- Sub reference_DblClick ()
- del_doc_click
- End Sub
- Sub reference_DragDrop (Source As Control, X As Single, Y As Single)
- If Source.Tag = "TITLE" Then
- add_doc_click
- End If
- End Sub
- Sub reference_MouseDown (Button As Integer, Shift As Integer, X As Single, Y As Single)
- If reference.ListIndex > -1 Then
- reference.Drag 1
- Else
- reference.Drag 0
- End If
- End Sub
- Sub reference_MouseUp (Button As Integer, Shift As Integer, X As Single, Y As Single)
- reference.Drag 0
- 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 sources_form.source_list.ListCount = 0 Then
- MsgBox "You must select at least one source. Use File/Select from menu bar to select sources.", MB_INFO
- search.Value = False
- Exit Sub
- End If
- mousepointer = HOURGLASS
- title.Clear
- 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 sources_form.source_list.ListCount - 1
- If X > 0 Then
- func = 1
- End If
- If X = sources_form.source_list.ListCount - 1 Then
- func = 2
- End If
-
- kw$ = keywords.Text
- If Len(kw$) = 0 Then
- kw$ = " "
- End If
- log_status " Querying " + src_database(X) + " at " + src_service(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
- 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_type(docno) = headline.type
- title_length(docno) = headline.length
- tscore$ = String$(headline.score / 250, 15) '240)
- tscore$ = tscore$ + Space$(4 - Len(tscore$))
- If headline.length > 10238976 Then
- tlength$ = " >9999K "
- Else
- tlength$ = Format$(headline.length / 1024, "###.0K")
- tlength$ = Space$(7 - Len(tlength$)) + tlength$ + " "
- End If
- ts = InStr(sources_form.source_list.List(headline.Source), " ")
- If ts = 0 Or ts > 4 Then
- ts = 4
- End If
- tsource$ = Left$(sources_form.source_list.List(headline.Source), ts) + Space$(5 - ts)
- msg$ = tscore$ + tlength$ + tsource$ + Trim$(headline.title)
- title.AddItem msg$
- docno = docno + 1
- End If
- Wend
- search.Value = False
- mousepointer = DEFAULT
- End Sub
- Sub slip_dial_click ()
- z = Shell("waisdial", 1)
- 'dial_form.Show 1
- 'Unload dial_form
- End Sub
- Sub slipdial_bbox_Click ()
- slip_dial_click
- End Sub
- Function temp_file (type_code As String) As String
- Static file_no As Integer
- If file_list(file_no) <> "" Then
- fn$ = temp_path + "\WAIS" + Format$(file_no, "0000") + "." + file_list(file_no)
- Kill fn$
- End If
- file_list(file_no) = type_code
- fn$ = temp_path + "\WAIS" + Format$(file_no, "0000") + "." + type_code
- Name temp_path + "\WAIS.$$$" As fn$
- file_no = file_no + 1
- If file_no = MAX_TEMP_FILES Then
- file_no = 0
- End If
- temp_file = fn$
- End Function
- Sub test_for_error (stat As Integer, docno As Integer)
-
- Select Case stat
- Case 0
- Exit Sub
- Case 1
- log_status " Found" + Str$(docno + 1) + " references"
- Case 2
- log_status " Server connection failed"
- Case 3
- log_status " Request was too large to handle"
- Case 4
- log_status " Returned message was too large to handle"
- Case 5
- log_status " Server returned diagnostics in response to query"
- Case 6
- log_status " Error 6"
- Case 7
- log_status " Invalid document number was requested"
- Case 8
- log_status " No matching references were found"
- Case Else
- log_status Str$(stat) + " is an unknown error number"
- End Select
- z = DoEvents()
- End Sub
- Sub title_dblclick ()
- Dim docno As Integer
- Dim query_type As String
- Dim doc_lines As Integer
- Dim stat As Integer
- Dim rec As String * MAX_TEXT_LENGTH
- Dim full_block As String * MAX_SAVE_BLOCK
- Dim headline As DOC
- If title.ListIndex < 0 Then
- MsgBox "You must select a document to retrieve", MB_INFO
- Exit Sub
- End If
- doc_selected = NORMAL
- While doc_selected <> NONE
-
- X = DoEvents()
- mousepointer = HOURGLASS
- Select Case doc_selected
-
- Case NORMAL
- docno = title.ListIndex
- log_status " Getting " + Right$(title.List(docno), Len(title.List(docno)) - 17)
-
- Case DOC_NEXT_INORDER
- log_status " Getting next document..."
- stat = get_next_or_prev("WAIS_NEXT", headline)
- test_for_error stat, 0
- If stat Then
- mousepointer = DEFAULT
- Exit Sub
- End If
- docno = CURRDOC
- Case DOC_NEXT_LISTED
- If docno = CURRDOC Then
- docno = title.ListIndex
- End If
- docno = docno + 1
- log_status " Getting " + Right$(title.List(docno), Len(title.List(docno)) - 17)
- title.ListIndex = docno
-
- Case DOC_PREV_INORDER
- log_status " Getting previous document..."
- stat = get_next_or_prev("WAIS_PREV", headline)
- test_for_error stat, 0
- If stat Then
- mousepointer = DEFAULT
- Exit Sub
- End If
- docno = CURRDOC
- Case DOC_PREV_LISTED
- If docno = CURRDOC Then
- docno = title.ListIndex
- End If
- docno = docno - 1
- log_status " Getting " + Right$(title.List(docno), Len(title.List(docno)) - 17)
- title.ListIndex = docno
-
- End Select
-
- If docno = CURRDOC Then
- wk_type$ = headline.type
- viewed_headline = Trim$(headline.title)
- Else
- If docno < 0 Or docno = title.ListCount Then
- mousepointer = DEFAULT
- Exit Sub
- End If
- wk_type$ = title_type(docno)
- viewed_headline = Right$(title.List(docno), Len(title.List(docno)) - 17)
- End If
- viewed_docno = docno
-
- If InStr(wk_type$, ",") Then
- multi_form.Tag = wk_type$
- multi_form.Show 1
- tcode$ = multi_form.Tag
- Unload multi_form
- If tcode$ = "CANCEL" Then
- mousepointer = DEFAULT
- Exit Sub
- End If
- Else
- tcode$ = Left$(wk_type$, InStr(wk_type$, Chr$(0)) - 1)
- End If
-
- stat = get_document(docno, tcode$)
- test_for_error stat, docno
- If stat = 0 Then
- file_dialog.DialogTitle = "WAIS save for type " + tcode$
- If tcode$ = "TEXT" Then
- view_form.Show 1
- Unload view_form
- ElseIf tcode$ = "WSRC" Then
- wsrc_form.Show 1
- Unload wsrc_form
- Else
- doc_selected = NONE
- task_id = 0
- For X = 0 To 9
- If tcode$ = filter_type_code(X) Then
- cmd$ = filter_name(X) + " " + temp_file(filter_ext(X))
- task_id = Shell(cmd$, 1)
- Exit For
- End If
- Next X
- If task_id = 0 Then
- GoSub save_unknown_type
- End If
- End If
- Else
- doc_selected = NONE
- End If
- mousepointer = DEFAULT
- Wend
- Exit Sub
- save_unknown_type:
- cur_dir$ = CurDir$
- On Error Resume Next
- file_dialog.Action = 2
- Select Case Err
-
- Case 0
- mousepointer = HOURGLASS
- tmp_handle = FreeFile
- Open temp_path + "\WAIS.$$$" For Binary Access Read As tmp_handle Len = 32760
- save_handle = FreeFile
- Open file_dialog.Filename For Output As save_handle
-
- filesize = LOF(tmp_handle)
- While filesize > MAX_SAVE_BLOCK
- Get #tmp_handle, , full_block
- Print #save_handle, full_block;
- filesize = filesize - MAX_SAVE_BLOCK
- Wend
-
- the_rest$ = Space$(filesize)
- Get #tmp_handle, , the_rest$
- Print #save_handle, the_rest$;
- Close (tmp_handle)
- Close (save_handle)
- mousepointer = DEFAULT
-
- Case 32755
- Return
-
- Case Else
- msg$ = "Save failed with code" + Str$(Err) + ", save cancelled."
- MsgBox msg$, MB_WARN
- End Select
- ChDir cur_dir$
- Return
- End Sub
- Sub title_DragDrop (Source As Control, X As Single, Y As Single)
- If Source.Tag = "REF" Then
- del_doc_click
- End If
- End Sub
- Sub title_KeyPress (KeyAscii As Integer)
- If KeyAscii = 13 Then
- title_dblclick
- KeyAscii = 0
- End If
- End Sub
- Sub title_MouseDown (Button As Integer, Shift As Integer, X As Single, Y As Single)
- If title.ListIndex > -1 Then
- title.Drag 1
- Else
- title.Drag 0
- End If
- End Sub
- Sub title_MouseUp (Button As Integer, Shift As Integer, X As Single, Y As Single)
- title.Drag 0
- End Sub
- Sub using_menu_Click ()
- z = WinHelp(hWnd, "wais.hlp", HELP_INDEX, 0)
- End Sub
-