home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Carsten's PPE Collection
/
Carstens_PPE_Collection_2007.zip
/
S
/
SRCH200.ZIP
/
SEARCH.SCR
< prev
next >
Wrap
Text File
|
1993-03-24
|
13KB
|
312 lines
; *****************************************************************
; * *
; * S E A R C H V 1 . 0 *
; * Comprehensive search "command" for PCBoard V15.0 *
; * *
; * Written in "The" language for PCBoard *
; * *
; * Designed By: Steve Catmull *
; * *
; * Began development: 02-06-93 *
; * *
; *****************************************************************
;
; This command enables users to search either the message base,
; or the file areas for specific text.
;
STRING srch_slct ; Used to store choice of messages/files
STRING fsrch_slct ; Search by filename or description.
STRING filename ; File_Srch - filename(s) to search
STRING directories ; File_Srch - Directories to search
DATE file_date ; File_Srch - Scan for files after this date
STRING flag_match ; File_Srch - Download Flagged Files?
STRING file_chars ; Valid characters for a filename
STRING temp,temp2 ; For whatever.
STRING zsearch, nozsearch ; For (Z)ippy type scans.
STRING z_command,l_command ; Holds the actual strings that are stuff to keyb.
; -----------------------------------------------------------------------
; Initialize Variables
; -----------------------------------------------------------------------
GETUSER
flag_match="No"
file_chars="!$%&'()*+-./0123456789:;=?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿αß"
file_date = 000000
directories="A"
; -----------------------------------------------------------------------
; Ask if user wishes to search through message base or file areas
; -----------------------------------------------------------------------
;CLS
;PRINTLN "@X20┌──────────────────────────────────@X2A┐@X07"
;PRINTLN "@X20│ @X2FSearch File Directories @X2A│@X07"
;PRINTLN "@X20└@X2A──────────────────────────────────┘@X07"
;PRINTLN
;PRINTLN " @X0E(@X0F1@X0E) File descriptions@X07"
;PRINTLN " @X0E(@X0F2@X0E) Message bases@X07"
;PRINTLN ""
;INPUTSTR "Which area would you like to search for text (1-2)",srch_slct,0Ah,1,"12",270
;IF (srch_slct = "1") GOTO File_Srch
;GOTO Msg_Srch
; -----------------------------------------------------------------------
; User informed us they wish to search the file areas. Now ask to see
; if they wish to search by filename or description
; -----------------------------------------------------------------------
:File_Srch
CLS
PRINTLN "@X20┌────────────────────────────────────@X2A┐@X07"
PRINTLN "@X20│@X2F Search File Areas @X2A│@X07"
PRINTLN "@X20└@X2A────────────────────────────────────┘@X07"
PRINTLN
PRINTLN " @X0E(@X0F1@X0E) Locate by filename@X07"
PRINTLN " @X0E(@X0F2@X0E) Find text in any description@X07"
PRINTLN " @X0E(@X0FQ@X0E) Quit Search@X07"
PRINTLN
INPUTSTR "Which would you like to search through (1-2)",fsrch_slct,0Ah,1,"12Q",270
IF (fsrch_slct = "1") GOTO LFile_Srch
IF (fsrch_slct = "2") GOTO ZFile_Srch
IF (fsrch_slct = "" ) END
IF (fsrch_slct = "Q") END
PRINTLN
PRINTLN "@X0CInvalid selection entered.@X07"
PRINTLN
PRINTLN "@QOFF@@MORE@@QON@"
GOTO File_Srch
; -----------------------------------------------------------------------
; User choose to locate by filename. Display current search criteria and
; display options available to user.
; -----------------------------------------------------------------------
:LFile_Srch
fsrch_slct = ""
GOSUB LSearch_Params
INPUTSTR "@X0AChange (@X0FF@X0A)ilename (@X0FD@X0A)irectories (@X0FN@X0A)ew date F(@X00@X0FL@XFF)ag (@X0FQ@X0A)uit (@X0FS@X0A)earch",fsrch_slct,0Ah,1,"FDNLSQ",270
IF (fsrch_slct = "F") GOSUB Change_File
IF (fsrch_slct = "D") GOSUB Change_Dirs
IF (fsrch_slct = "N") GOSUB Change_Date
IF (fsrch_slct = "L") GOSUB Change_Flagged
IF (fsrch_slct = "S") GOTO GoFile_Search
IF (fsrch_slct = "") GOTO File_Srch
IF (fsrch_slct = "Q") END
GOTO LFile_Srch
END
; -----------------------------------------------------------------------
; User has selected to modify the filename to search for
; -----------------------------------------------------------------------
:Change_File
IF (!U_EXPERT) DISPFILE PPEPATH()+"LOCATE.SRC",1
INPUTSTR "Enter filename to search for",filename,0Ah,12,file_chars,170
RETURN
; --------------------------------------------------------------------------
; User has selected to change directories to search for.
; --------------------------------------------------------------------------
:Change_Dirs
IF (!U_EXPERT) DISPFILE PPEPATH()+"DIRS.SRC",1
INPUTSTR "Enter directories to include in your search",directories,0Ah,25," 0123456789AUP-,",170
RETURN
; --------------------------------------------------------------------------
; User has selected to restrict search to files dated equal to of after date
; --------------------------------------------------------------------------
:Change_Date
PRINTLN
PRINTLN "@X03If you @X00@X0Bdo not want to search@XFF for files @X0Bbased on the date@XFF of the file then"
PRINTLN "enter a date of @X0F0@XFF. This will exclude the date from the search."
PRINTLN
INPUTDATE "Enter new date to begin searching for files",file_date,0Ah
RETURN
; --------------------------------------------------------------------------
; User has selected to toggled flag status. Files found in search may be
; selected to be flagged for download.
; --------------------------------------------------------------------------
:Change_Flagged
temp = flag_match
IF (temp = "Yes") flag_match = "No"
IF (temp = "No") flag_match = "Yes"
RETURN
; --------------------------------------------------------------------------
; Go ahead and stuff the keyboard with the search string user has created.
; --------------------------------------------------------------------------
:GoFile_Search
GOSUB CRUNCH_DATE
GOSUB Build_L
LOG "SEARCH: "+l_command,0
IF (l_command = "No search created yet") END
KBDSTUFF l_command
END
; --------------------------------------------------------------------------
;
; --------------------------------------------------------------------------
:ZFile_Srch
fsrch_slct = ""
GOSUB zsearch_Params
INPUTSTR "@X0AChange (@X0FM@X0A)atching (@X0FE@X0A)xclude (@X0FN@X0A)ew date (@X0FF@X0A)lag (@X0FD@X0A)irs (@X0FQ@X0A)uit (@X0FS@X0A)earch",fsrch_slct,0Ah,1,"MENFDQS",270
IF (fsrch_slct = "M") GOSUB Z_MATCH
IF (fsrch_slct = "E") GOSUB Z_EXCLUDE
IF (fsrch_slct = "N") GOSUB Change_Date
IF (fsrch_slct = "F") GOSUB Change_Flagged
IF (fsrch_slct = "D") GOSUB Change_Dirs
IF (fsrch_slct = "S") GOTO Z_Search
IF (fsrch_slct = "") GOTO File_Srch
IF (fsrch_slct = "Q") END
GOTO ZFile_Srch
END
; --------------------------------------------------------------------------
;
; --------------------------------------------------------------------------
:Z_Search
GOSUB Build_Z
LOG "SEARCH: "+z_command,0
IF (z_command = "No search created yet") END
KBDSTUFF z_command
END
; --------------------------------------------------------------------------
; Build both the display and the actual search string for the (Z) command.
; --------------------------------------------------------------------------
:Build_Z
IF (!(LEFT(zsearch,1)="(" & RIGHT(zsearch,1)=")") & (INSTR(zsearch,"&")<>0) | (INSTR(zsearch,"|")<> 0)) zsearch = "("+zsearch+")"
IF ((!(LEFT(nozsearch,1)="(" & RIGHT(nozsearch,1)=")") & (((INSTR(nozsearch,"&")<>0) | (INSTR(nozsearch,"|")<>0))))) nozsearch = "("+nozsearch+")"
IF (flag_match = "Yes") temp2 = " D"
IF (flag_match = "No") temp2 = ""
IF (file_date=000000) temp = ""
IF (file_date<>000000) GOSUB CRUNCH_DATE
IF (file_date<>000000) temp = "N "+temp+" "
IF (nozsearch <> "") z_command="Z "+zsearch+" & ! "+nozsearch+" "+temp+directories+temp2
IF (nozsearch = "") z_command="Z "+zsearch+" "+temp+directories+temp2
IF (zsearch = "") z_command="Z ! "+nozsearch+" "+temp+directories+temp2
IF (nozsearch = "" & zsearch = "") z_command="No search created yet"
RETURN
; --------------------------------------------------------------------------
; Build both the display and the actual search string for the (L) command.
; --------------------------------------------------------------------------
:Build_L
IF (file_date <> 000000) THEN
GOSUB CRUNCH_DATE
l_command="L "+filename+" N "+temp+" "+directories
ENDIF
IF (file_date = 000000) l_command="L "+filename+" "+directories
IF (flag_match = "Yes") l_command=l_command+" D"
IF (filename="") l_command="No search created yet"
RETURN
; --------------------------------------------------------------------------
; Prompt the user for the text they want to exclude in (Z) search.
; --------------------------------------------------------------------------
:Z_EXCLUDE
IF (!U_EXPERT) DISPFILE PPEPATH()+"ZXCLUDE.SRC",1
PRINTLN
INPUTSTR "Enter text to exclude",nozsearch,0Ah,54,file_chars+"|",30
RETURN
; --------------------------------------------------------------------------
; Prompt user for the text that they want to include in the (Z) search.
; --------------------------------------------------------------------------
:Z_MATCH
IF (!U_EXPERT) DISPFILE PPEPATH()+"ZMATCH.SRC",1
PRINTLN
INPUTSTR "Enter Text to Search For",zsearch,0Ah,54,file_chars+"|",30
RETURN
; --------------------------------------------------------------------------
; Strip the date of "-" characters so that PCBoard will recognize the date.
; --------------------------------------------------------------------------
:Crunch_Date
temp = LEFT(file_date,2)+MID(file_date,4,2)+RIGHT(file_date,2)
RETURN
; -----------------------------------------------------------------------
; Display currently selected search parameters for the (Z)ippy command.
; -----------------------------------------------------------------------
:zsearch_Params
CLS
GOSUB Build_Z
PRINTLN "@X10┌──────────────────────────────────────────────@X19┐@X07"
PRINTLN "@X10│ @X1FFile Text Search Criteria @X19│@X07"
PRINTLN "@X10└@X19──────────────────────────────────────────────┘@X07"
PRINTLN
PRINTLN
PRINTLN "@X0AMatching: @X0F", zsearch
PRINTLN "@X0A Exclude: @X0F", nozsearch
PRINTLN
IF (file_date = 000000) PRINTLN "@X0AAny file date greater than or equal to: @X07N/A"
IF (!file_date= 000000) PRINTLN "@X0AAny file date greater than or equal to: @X0F", file_date
PRINTLN "@X0AIn the following directories (A = ALL): @X0F", directories
PRINTLN " @X0AFlag matching files for download: @X0F", flag_match
PRINTLN
PRINTLN "@X0E Although the search will automatically be performed when you select"
PRINTLN " the S option below, you can type following at a conference command"
PRINTLN " prompt to perform the same search:"
PRINTLN
PRINTLN " @X0F"+z_command
NEWLINES 2
RETURN
; -----------------------------------------------------------------------
; Display currently selected search parameters for the (L)ocate command.
; -----------------------------------------------------------------------
:LSearch_Params
CLS
GOSUB Build_L
PRINTLN "@X20┌──────────────────────────────────────────────@X2A┐@X07"
PRINTLN "@X20│ @X2FFilename Search Criteria @X2A│@X07"
PRINTLN "@X20└@X2A──────────────────────────────────────────────┘@X07"
PRINTLN
PRINTLN "@X0E Filename(s) to search for: @X0F",filename
PRINTLN "@X0E Directories to scan (A = All): @X0F",directories
IF (file_date = 00000) PRINTLN "@X0E Scan all files newer than: @X07N/A"
IF (!file_date= 00000) PRINTLN "@X0E Scan all files newer than: @X0F",file_date
PRINTLN "@X0EFlag matching files for download: @X0F",flag_match
PRINTLN
PRINTLN "@X03 Although the search will automatically be performed when you select"
PRINTLN " the S option below, you can type following at a conference command"
PRINTLN " prompt to perform the same search:"
PRINTLN
PRINTLN " @X0F"+l_command
NEWLINES 2
RETURN