home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CP/M
/
CPM_CDROM.iso
/
mbug
/
mbug107.arc
/
RETRIEVE.LBR
/
FIND.CQD
/
FIND.CMD
Wrap
OS/2 REXX Batch file
|
1979-12-31
|
8KB
|
258 lines
NOTE - EXTENDED COMMAND FILE FIND.CMD
USE &FILE1
GO BOTTOM
STORE STR(#,4) TO REC:NO
STORE TRIM(REC:NO) TO REC:NO
STORE '*** REFS.DBF CONTAINS '+REC:NO+' RECORDS ***' TO MESSAGE
STORE 40-(LEN(MESSAGE)/2) TO COLUMN
ERASE
@ 4,COLUMN SAY MESSAGE
@ 6,24 SAY 'EACH RECORD CONSISTS OF 5 FIELDS:'
@ 8,28 SAY '(1) REF:NO (4) SOURCE'
@ 9,28 SAY '(2) AUTHORS (5) KWORDS'
@ 10,28 SAY '(3) TITLE'
STORE ' ' TO FLD1
STORE ' ' TO FLD2
STORE ' ' TO FLD3
STORE ' ' TO SSTR1
STORE ' ' TO SSTR2
STORE ' ' TO SSTR3
STORE 'N' TO PRINT
@ 12,20 SAY '________________________________________'
@ 14,25 SAY '** ENTER SEARCH INFORMATION **'
@ 16,6 SAY '1st FIELD TO SEARCH ON (1-5) ' GET FLD1 PICTURE '9'
@ 16,40 SAY 'SUBSTRING TO LOCATE ' GET SSTR1 PICTURE 'XXXXXXXXXXXXXXX'
@ 17,6 SAY '2nd FIELD TO SEARCH ON (1-5) ' GET FLD2 PICTURE '9'
@ 17,40 SAY 'SUBSTRING TO LOCATE ' GET SSTR2 PICTURE 'XXXXXXXXXXXXXXX'
@ 18,6 SAY '3rd FIELD TO SEARCH ON (1-5) ' GET FLD3 PICTURE '9'
@ 18,40 SAY 'SUBSTRING TO LOCATE ' GET SSTR3 PICTURE 'XXXXXXXXXXXXXXX'
@ 20,22 SAY 'DO YOU WANT RESULTS PRINTED? (Y/N) ' GET PRINT PICTURE 'A'
READ
IF FLD1='1'
STORE 'REF:NO' TO FLD1
ELSE
IF FLD1='2'
STORE 'AUTHORS' TO FLD1
ELSE
IF FLD1='3'
STORE 'TITLE' TO FLD1
ELSE
IF FLD1='4'
STORE 'SOURCE' TO FLD1
ELSE
IF FLD1='5'
STORE 'KWORDS' TO FLD1
ENDIF
ENDIF
ENDIF
ENDIF
ENDIF
IF FLD2='1'
STORE 'REF:NO' TO FLD2
ELSE
IF FLD2='2'
STORE 'AUTHORS' TO FLD2
ELSE
IF FLD2='3'
STORE 'TITLE' TO FLD2
ELSE
IF FLD2='4'
STORE 'SOURCE' TO FLD2
ELSE
IF FLD2='5'
STORE 'KWORDS' TO FLD2
ENDIF
ENDIF
ENDIF
ENDIF
ENDIF
IF FLD3='1'
STORE 'REF:NO' TO FLD3
ELSE
IF FLD3='2'
STORE 'AUTHORS' TO FLD3
ELSE
IF FLD3='3'
STORE 'TITLE' TO FLD3
ELSE
IF FLD3='4'
STORE 'SOURCE' TO FLD3
ELSE
IF FLD3='5'
STORE 'KWORDS' TO FLD3
ENDIF
ENDIF
ENDIF
ENDIF
ENDIF
STORE TRIM(SSTR1) TO SSTR1
STORE TRIM(SSTR2) TO SSTR2
STORE TRIM(SSTR3) TO SSTR3
IF FLD3<>' '
@ 20,22 SAY ' '
@ 20,27 SAY '*** LOCATING RECORD(S) ***'
LOCATE FOR !(SSTR1)$!(&FLD1) .AND. !(SSTR2)$!(&FLD2);
.AND. !(SSTR3)$!(&FLD3)
ELSE
IF FLD2<>' '
@ 20,22 SAY ' '
@ 20,27 SAY '*** LOCATING RECORD(S) ***'
LOCATE FOR !(SSTR1)$!(&FLD1) .AND. !(SSTR2)$!(&FLD2)
ELSE
@ 20,22 SAY ' '
@ 20,27 SAY '*** LOCATING RECORD(S) ***'
LOCATE FOR !(SSTR1)$!(&FLD1)
ENDIF
ENDIF
IF !(PRINT)='Y'
ERASE
@ 11,23 SAY '*** MAKE SURE PRINTER IS READY ***'
@ 13,24 SAY '*** PRESS ANY KEY TO CONTINUE ***'
@ 22,1 SAY ' '
WAIT
ERASE
@ 12,31 SAY '**** SEARCHING ****'
@ 22,1 SAY ' '
STORE 5 TO LINE
SET FORMAT TO PRINT
SET EJECT OFF
DO WHILE .NOT. EOF
STORE $(AUTHORS,1,40) TO AU1
STORE $(AUTHORS,41,40) TO AU2
STORE $(TITLE,1,40) TO TI1
STORE $(TITLE,41,40) TO TI2
STORE $(TITLE,81,40) TO TI3
STORE $(TITLE,121,40) TO TI4
STORE $(SOURCE,1,40) TO SO1
STORE $(SOURCE,41,40) TO SO2
STORE $(KWORDS,1,40) TO KW1
STORE $(KWORDS,41,40) TO KW2
@ LINE,14 SAY 'REF. NO.: '+REF:NO USING 'XXXXXXXXXXXXXXX'
STORE LINE+1 TO LINE
@ LINE,13 SAY 'AUTHOR(S): '+AU1 USING;
'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
IF AU2<>' '
STORE LINE+1 TO LINE
@ LINE,24 SAY AU2 USING;
'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
ENDIF
STORE LINE+1 TO LINE
@ LINE,17 SAY 'TITLE: '+TI1 USING;
'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
IF TI2<>' '
STORE LINE+1 TO LINE
@ LINE,24 SAY TI2 USING;
'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
IF TI3<>' '
STORE LINE+1 TO LINE
@ LINE,24 SAY TI3 USING;
'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
IF TI4<>' '
STORE LINE+1 TO LINE
@ LINE,24 SAY TI4 USING;
'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
ENDIF
ENDIF
ENDIF
STORE LINE+1 TO LINE
@ LINE,16 SAY 'SOURCE: '+SO1 USING;
'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
IF SO2<>' '
STORE LINE+1 TO LINE
@ LINE,24 SAY SO2 USING;
'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
ENDIF
STORE LINE+1 TO LINE
@ LINE,13 SAY 'KEY WORDS: '+KW1 USING;
'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
IF KW2<>' '
STORE LINE+1 TO LINE
@ LINE,24 SAY KW2 USING;
'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
ENDIF
STORE LINE+2 TO LINE
IF LINE=55 .OR. LINE>55
SET EJECT ON
EJECT
STORE 5 TO LINE
ENDIF
CONTINUE
ENDDO
@ 60,1 SAY ' '
SET FORMAT TO SCREEN
ERASE
@ 11,21 SAY '************** FINISHED ***************'
@ 13,21 SAY '*** PRESS ANY KEY TO RETURN TO MENU ***'
@ 22,1 SAY ' '
WAIT
RETURN
ENDIF
STORE 1 TO LINE
DO WHILE .NOT. EOF
ERASE
STORE $(AUTHORS,1,40) TO AU1
STORE $(AUTHORS,41,40) TO AU2
STORE $(TITLE,1,40) TO TI1
STORE $(TITLE,41,40) TO TI2
STORE $(TITLE,81,40) TO TI3
STORE $(TITLE,121,40) TO TI4
STORE $(SOURCE,1,40) TO SO1
STORE $(SOURCE,41,40) TO SO2
STORE $(KWORDS,1,40) TO KW1
STORE $(KWORDS,41,40) TO KW2
ERASE
@ LINE,14 SAY 'REF. NO.: '+REF:NO
STORE LINE+1 TO LINE
@ LINE,13 SAY 'AUTHOR(S): '+AU1
IF AU2<>' '
STORE LINE+1 TO LINE
@ LINE,24 SAY AU2
ENDIF
STORE LINE+1 TO LINE
@ LINE,17 SAY 'TITLE: '+TI1
IF TI2<>' '
STORE LINE+1 TO LINE
@ LINE,24 SAY TI2
IF TI3<>' '
STORE LINE+1 TO LINE
@ LINE,24 SAY TI3
IF TI4<>' '
STORE LINE+1 TO LINE
@ LINE,24 SAY TI4
ENDIF
ENDIF
ENDIF
STORE LINE+1 TO LINE
@ LINE,16 SAY 'SOURCE: '+SO1
IF SO2<>' '
STORE LINE+1 TO LINE
@ LINE,24 SAY SO2
ENDIF
STORE LINE+1 TO LINE
@ LINE,13 SAY 'KEY WORDS: '+KW1
IF KW2<>' '
STORE LINE+1 TO LINE
@ LINE,24 SAY KW2
ENDIF
STORE LINE+2 TO LINE
IF LINE=5 .OR. LINE>5
@ 14,26 SAY '** WANT TO CONTINUE? (Y/N) **'
@ 22,1 SAY ' '
WAIT TO CONTINUE
IF !(CONTINUE)='N'
RETURN
ENDIF
STORE 1 TO LINE
ENDIF
ERASE
@ 12,31 SAY '**** SEARCHING ****'
CONTINUE
ENDDO
ERASE
@ 20,21 SAY '************** FINISHED ***************'
@ 21,21 SAY '*** PRESS ANY KEY TO RETURN TO MENU ***'
@ 22,1 SAY ' '
WAIT
RELEASE REC:NO,MESSAGE,COLUMN,FLD1,FLD2,FLD3,SSTR1,SSTR2,SSTR3,PRINT,CONTINUE
RETURN