home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.barnyard.co.uk
/
2015.02.ftp.barnyard.co.uk.tar
/
ftp.barnyard.co.uk
/
cpm
/
walnut-creek-CDROM
/
MBUG
/
MBUG061.ARC
/
LIBADD.CMD
< prev
next >
Wrap
OS/2 REXX Batch file
|
1979-12-31
|
3KB
|
99 lines
*************************************** LIBADD.CMD
*************************************** Add new data.
************** Open Data Files
SELECT PRIMARY
USE LIBRARY INDEX AUTHORS,DATES
SELECT SECONDARY
USE KEYWORDS INDEX KEYWORDS
SET EXACT ON
************** Initialize memory variables.
STORE " " TO K1,K2,K3,K4,K5,K6,K7
SELECT PRIMARY
GO BOTT
DO WHILE AUTHOR <> " " .OR. # <= 1
************ Display custom APPEND screen, (which
************ was created with ZIP).
ERASE
APPEND BLANK
@ 1, 3 SAY "Record No. "+STR(#,3)+" Enter new Data, ^Q to Quit"
@ 2, 0 SAY "--------------------------------------------------"
@ 2,50 SAY "------------------------------"
@ 4, 3 SAY "Author"
@ 4,12 GET AUTHOR
@ 5, 3 SAY "Title"
@ 5,12 GET TITLE
@ 6, 3 SAY "Pub."
@ 6,12 GET PUB
@ 7, 3 SAY "Date"
@ 7,12 GET DATE PICT "99/99/99"
@ 7,26 SAY "Pages"
@ 7,32 GET PAGES
@ 9, 3 SAY "Abstract"
@ 9,12 GET ABSTRACT
@ 13, 3 SAY "Keyword 1"
@ 13,13 GET K1
@ 14, 3 SAY "Keyword 2"
@ 14,13 GET K2
@ 15, 3 SAY "Keyword 3"
@ 15,13 GET K3
@ 16, 3 SAY "Keyword 4"
@ 16,13 GET K4
@ 17, 3 SAY "Keyword 5"
@ 17,13 GET K5
@ 18, 3 SAY "Keyword 6"
@ 18,13 GET K6
@ 19, 3 SAY "Keyword 7"
@ 19,13 GET K7
@ 21, 0 SAY "--------------------------------------------------"
@ 21,50 SAY "------------------------------"
READ
****************** ONLY perform this step if not exiting this program.
IF AUTHOR <> " "
****************** Update the Keyword File.
SELECT SECONDARY
STORE " " TO TEMPKEY
STORE 1 TO COUNT
STORE STR(COUNT,1) TO MAC
DO WHILE K&MAC <> " " .AND. COUNT < 8
STORE !(K&MAC) TO K&MAC
FIND &K&MAC
IF # > 0
REPLACE KEYNO WITH KEYNO+1
ELSE
APPEND BLANK
REPLACE KEYWORD WITH K&MAC
REPLACE KEYNO WITH 1
ENDIF (# > 0)
*** Put keyword into temporary TEMPKEY string.
STORE TEMPKEY+TRIM(K&MAC)+", " TO TEMPKEY
**** Clear out K&MAC memory variables, and increment count.
STORE " " TO K&MAC
STORE COUNT +1 TO COUNT
STORE STR(COUNT,1) TO MAC
ENDDO (k&mac<>" ")
ENDIF [not exiting this program (author <> "")]
SELECT PRIMARY
*********************** Put tempkey into keywords on Primary file.
REPLACE KEYWORDS WITH TEMPKEY
ENDDO (while author <> " ")
*********************** Get rid of any "blank" records.
DELETE ALL FOR AUTHOR = " " .AND. TITLE = " "
PACK
*********************** Return to Main Menu.
SET EXACT OFF
RETURN