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
/
MBUG102.ARC
/
ADD.CMD
< prev
next >
Wrap
OS/2 REXX Batch file
|
1979-12-31
|
4KB
|
132 lines
*ADD.PRG
* A PROGRAM TO ADD A NEW RECORD TO THE DATABASE FILE
RELEASE ALL
SET INTENSITY OFF
DO WHILE T
ERASE
@ 2,0 SAY '+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++'
@ 4,0 SAY ' THIS PROGRAM ALLOWS A NEW RECORD TO BE ADDED TO THE FILE'
@ 6,0 SAY ' KEY..................MODE'
@ 8,0 SAY ' 1 TO ADD TO THE PRICELIST'
@ 10,0 SAY' 2 TO ADD TO THE NAME LIST'
@ 12,0 SAY ' R TO RETURN TO THE MAIN MENU'
@ 15,0 SAY' CONTROL "W" TO SAVE THE ADDITION ,"Q" TO QUIT '
@ 16,0 SAY '++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++'
SET TALK OFF
WAIT TO DEC
STORE !(DEC) TO DEC
IF DEC='R'
RETURN
ENDIF
IF DEC='1'
STORE 'PRICELIS' TO FILE
ENDIF
IF DEC='2'
STORE 'NAMELIST' TO FILE
ENDIF
USE &FILE
STORE ' ' TO DEC2
DO WHILE DEC2=' '
APPEND BLANK
IF FILE='NAMELIST'
*********************************
STORE ACCNUM TO ACCNUMA
STORE NAME TO NAMEA
STORE STREET TO STREETA
STORE CITYPC TO CITYPCA
STORE DISCOUNT TO DISCOUNTA
STORE TAXNUM TO TAXNUMA
STORE CONTACT TO CONTACTA
STORE DATENTER TO DATEA
STORE RESALE TO RESALEA
STORE ALTNAME TO ALTNA
STORE ALTSTREET TO ALTST
STORE ALTCITYPC TO ALTCP
ERASE
@ 1,0 SAY '*********************************************************'
@ 2,0 SAY 'NAME OF ACCOUNT ALPHA FIRST '
@ 2,30 GET NAMEA
@ 3,0 SAY 'ACCOUNT NUMBER '
@ 3,30 GET ACCNUMA
@ 4,0 SAY ' STREET '
@ 4,30 GET STREETA
@ 5,0 SAY ' CITY POSTCODE '
@ 5,30 GET CITYPCA
@ 6,0 SAY ' CONTACT '
@ 6,30 GET CONTACTA
@ 7,0 SAY 'DATE LAST AMENDED'
@ 7,30 SAY DATEA
@ 8,0 SAY ' DISCOUNT ALLOWED ON TRANSACTIONS '
@ 8,40 GET DISCOUNTA
@ 9,0 SAY ' SALES TAX NUMBER IF APPLICABLE '
@ 9,40 GET TAXNUMA
@ 10,0 SAY ' ARE THE GOODS TO BE PURCHASED FOR RESALE T=TRUE'
@ 10,40 GET RESALEA
@ 11,0 SAY '*********************************************************'
@ 12,0 SAY ' INSERT NAME OF ALTERNATIVE DELIVERY POINT ' GET ALTNA
@ 13,0 SAY ' ALTERNATE DELIVERY ADDRESS (IF DIFFERENT) ' GET ALTST
@ 14,0 SAY ' ALTERNATE CITY AND POST CODE ' GET ALTCP
@ 15,0 SAY 'ENTER DATA NOW AND PRESS RETURN TO ADD AMENDMENT TO NAMELIST'
@ 16,0 SAY '^G TO DELETE CHAR, ^V TO ENTER INSERT MODE '
@ 17,0 SAY '********************************************************'
READ
********************************************************
REPLACE ACCNUM WITH ACCNUMA,NAME WITH NAMEA,STREET WITH STREETA,;
CITYPC WITH CITYPCA,CONTACT WITH CONTACTA,DISCOUNT WITH DISCOUNTA,;
DATENTER WITH DATE(),RESALE WITH RESALEA
REPLACE ALTNAME WITH ALTNA,ALTSTREET WITH ALTST,ALTCITYPC WITH ALTCP,;
TAXNUM WITH TAXNUMA
ENDIF
IF FILE='PRICELIS'
ERASE
STORE CODE TO CODEA
STORE ITEM TO ITEMA
STORE COST TO COSTA
STORE STOCKED TO STOCKEDA
STORE DATE TO DATEA
STORE TAX TO TAXA
STORE LAND:COST TO LAND
@ 1,0 SAY '*********************************************************'
@ 2,0 SAY 'PRODUCT CODE'
@ 2,25 GET CODEA
@ 3,0 SAY 'PRODUCT DESCRIPTION '
@ 3,25 GET ITEMA
@ 4,0 SAY 'PRODUCT BASE PRICE'
@ 4,25 GET COSTA
@ 4,40 SAY 'COST'
@ 4,50 GET LAND
@ 5, 0 SAY 'QUANTITY IN STOCK'
@ 5,25 GET STOCKEDA
@ 6,0 SAY 'DATE LAST AMENDED'
@ 6,20 SAY DATEA
@ 7,0 SAY ' SALESTAX RATE PAYABLE'
@ 7,25 GET TAXA
@ 8,0 SAY '*********************************************************'
@ 11,0 SAY 'ENTER DATA NOW AND PRESS RETURN TO ADD TO PRICELIST'
@ 12,0 SAY '^G TO DELETE CHAR, ^V TO ENTER INSERT MODE '
READ
REPLACE CODE WITH CODEA,ITEM WITH ITEMA,COST WITH COSTA,STOCKED WITH ;
STOCKEDA ,DATE WITH DATE(),TAX WITH TAXA,LAND:COST WITH LAND
ENDIF
ERASE
STORE ' ' TO DEC2
@ 12,0 SAY 'TO ADD ANOTHER RECORD TO THIS FILE PRESS <CR> '
@ 14,0 SAY 'TO EXIT AND TO REINDEX THIS FILE PRESS "E" KEY' GET DEC2
READ
IF DEC2=' '
LOOP
ENDIF
IF FILE='NAMELIST'
INDEX ON ACCNUM TO NAMENUM
INDEX ON NAME TO NAME
ENDIF
ENDIF
IF FILE='PRICELIS'
INDEX ON CODE TO PRICECOD
ENDIF
ENDDO
RETURN
HE PRICELIST'
@ 10,0 SAY' 2 TO ADD TO THE NAME LIST'
@ 12,0 SAY ' R TO RETURN TO THE MAIN MENU'
@ 15,0 SAY' CONTROL "W" TO SAV