home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Troubleshooting Netware Systems
/
CSTRIAL0196.BIN
/
attach
/
msj
/
v10n10
/
vb40.exe
/
WCIMR.EXE
/
WCSEARCH.BAS
< prev
next >
Wrap
BASIC Source File
|
1995-10-01
|
4KB
|
154 lines
Attribute VB_Name = "WCIMSearch"
Function FindStringInFolder(StrgFind As String) As String
' Searches all the threads in a folder for the occurrence
' of a string
Dim ThrdMsg As ForumThdMsg
Dim FNum As Integer
Dim ThdNum As Integer
Dim StrgDisp As String
If gNumThreads = 0 Then Exit Function
MainFrm.lvwThreads.ListItems.Clear
StrgDisp = ""
MainFrm.StatBar.Panels(1).TEXT = "Read 0 of " & gNumThreads & "."
MainFrm.ProgBar.MIN = 0
MainFrm.ProgBar.MAX = gNumThreads
For ThdNum = 1 To gNumThreads
MainFrm.ProgBar.Value = ThdNum
DoEvents
' Some joker hit the Stop Search button!
If gStopSearch = 1 Then Exit For
MainFrm.StatBar.Panels(1).TEXT = "Read " & ThdNum & " of " & gNumThreads & "."
Select Case msgtype(ThdNum) 'gThreadList(ThdNum).ComHdr.RecType
Case MT_UNDEF
Strg$ = ProcessUndef(ThdNum)
Case MT_EMAIL
Strg$ = ProcessEMail(ThdNum)
Case MT_FORMSG
Strg$ = ProcessMsg(ThdNum)
Case MT_FORTHD
Strg$ = ProcessThread(ThdNum)
Case MT_IPLEX
Strg$ = ProcessIPlex(ThdNum)
Case MT_DISP
Strg$ = ProcessDisp(ThdNum)
Case MT_ENS
Strg$ = ProcessNews(ThdNum)
End Select
' If we found the string, put the listing in
' the list of threads, not in the edit box
If (InStr(Strg$, StrgFind) > 0) Then
AddThreadToList (ThdNum)
' StrgDisp = StrgDisp & Strg$ & Chr$(13) & Chr$(10) & String(70, "=") & Chr$(13) & Chr$(10)
End If
Next ThdNum
' MainFrm.EdtMsgText.TEXT = StrgDisp
FindStringInFolder = ""
End Function
Function FindThread(SchStr As String) As Integer
FindThread = 0
' Try ListView.FindItem!
For i = 1 To gNumThreads
If StrComp(gThreadList(i).ComPStr.Subject.SData, SchStr) = 0 Then
' Convert path into 8.3
FindThread = i
Exit For
End If
Next i
End Function
Function FindByDate() As Integer
End Function
Function FindByUID() As Integer
' Searches all the threads in a folder for the occurrence
' of a sender/recipient
Dim ThrdMsg As ForumThdMsg
Dim FNum As Integer
Dim ThdNum As Integer
Dim StrgDisp As String
Dim UName$, UID$
If gNumThreads = 0 Then Exit Function
MainFrm.lvwThreads.ListItems.Clear
StrgDisp = ""
MainFrm.StatBar.Panels(1).TEXT = "Read 0 of " & gNumThreads & "."
MainFrm.ProgBar.MIN = 0
MainFrm.ProgBar.MAX = gNumThreads
For ThdNum = 1 To gNumThreads
MainFrm.ProgBar.Value = ThdNum
DoEvents
' Some joker hit the Stop Search button!
If gStopSearch = 1 Then Exit For
MainFrm.StatBar.Panels(1).TEXT = "Read " & ThdNum & " of " & gNumThreads & "."
Select Case msgtype(ThdNum) 'gThreadList(ThdNum).ComHdr.RecType
Case MT_UNDEF
Strg$ = ProcessUndef(ThdNum)
Case MT_EMAIL
Strg$ = ProcessEMail(ThdNum)
Case MT_FORMSG
Strg$ = ProcessMsg(ThdNum)
Case MT_FORTHD
Strg$ = ProcessThread(ThdNum)
Case MT_IPLEX
Strg$ = ProcessIPlex(ThdNum)
Case MT_DISP
Strg$ = ProcessDisp(ThdNum)
Case MT_ENS
Strg$ = ProcessNews(ThdNum)
End Select
' If we found the string, put the listing in
' the list of threads, not in the edit box
UName$ = gThreadList(ThdNum).ComPStr.Creator.SData
UID$ = gThreadList(ThdNum).ComPStr.CreAddr.SData
If MainFrm.Option1(0).Value = True Then 'Search by name
If (InStr(UName$, MainFrm.EdtSrchName) > 0) Then
AddThreadToList (ThdNum)
End If
End If
If MainFrm.Option1(1).Value = True Then 'Search by UID
If (InStr(UID$, MainFrm.EdtSrchUID) > 0) Then
AddThreadToList (ThdNum)
End If
End If
'If MainFrm.Option0(0).Value = True Then ' Search in Sent By
'If MainFrm.Option0(1).Value = True Then ' Search by Sent To
'If MainFrm.Option0(2).Value = True Then ' Search by Either
Next ThdNum
FindByUID = 0
End Function