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
/
EDIT1.CMD
< prev
next >
Wrap
OS/2 REXX Batch file
|
1979-12-31
|
6KB
|
203 lines
*EDIT1.PRG
*THIS PROGRAM ALLOWS FOR THE EDITING OF AN EXISTING FILE
* THIS COVERS ALL DATA FILES LIKE THE PRICELIST , NAMELIST ,LEDGER AND DATA'
RELEASE ALL
DO WHILE T
SET CONSOLE ON
STORE 00000 TO INV
ERASE
SET CONSOLE ON
@ 2,0 SAY'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++'
@ 4,0 SAY ' THIS PROGRAM ALLOWS FOR THE EDITING OF DATA IN EXISTING FILES'
@ 6,0 SAY ' PRESS THE KEY FOR THE REQUIRED MODE'
@ 8,0 SAY ' KEY ..............MODE'
@ 10,0 SAY ' 1 TO EDIT THE PRICELIST'
@ 11,0 SAY ' 2 TO EDIT THE NAME LIST'
@ 12,0 SAY ' 3 TO EDIT THE LEDGER'
@ 13,0 SAY ' 4 TO EDIT THE DATAFILE'
@ 14,0 SAY ' R TO RETURN TO THE MAIN MENU'
@ 17,0 SAY '++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++'
SET TALK OFF
SET CONSOLE OFF
WAIT TO DEC
STORE !(DEC) TO DEC
IF DEC='R'
SET CONSOLE ON
RETURN
ENDIF
IF DEC='1'
STORE 'PRICELIS INDEX PRICECOD' TO FILE
ENDIF
IF DEC='2'
STORE 'NAMELIST INDEX NAME' TO FILE
ENDIF
IF DEC='3'
STORE 'LEDGER' TO FILE
ENDIF
IF DEC='4'
STORE 'DATAFILE' TO FILE
ENDIF
SET CONSOLE ON
USE &FILE
**********************************************
IF FILE='PRICELIS INDEX PRICECOD'
************************************
*****************************************
*FIND A PRODUCT BY CODE FROM PRICELIS.DBF
USE &FILE
SET TALK OFF
ERASE
SET TALK OFF
STORE ' ' TO CODEA
@ 2,0 SAY ' PRODUCT CODE EXACTLY AS IN PRICELIST 'GET CODEA
READ
FIND &CODEA
IF #=0
@ 3,0 SAY 'PRODUCT NOT FOUND TRY AGAIN'
WAIT
LOOP
ENDIF
************************************
*****************************NEW SCREEN AND EDIT BY REPLACEMENT**
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 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 'SALES TAX RATE '
@ 7,20 GET TAXA
@ 8,0 SAY '*********************************************************'
@ 11,0 SAY 'AMEND NOW AND PRESS RETURN TO ADD AMENDMENT 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(),LAND:COST WITH LAND
ENDIF
********************************************************
IF FILE ='NAMELIST INDEX NAME'
*********************************************************
*FIND CUSTOMER ROUTINE
SET TALK OFF
ERASE
USE &FILE
RELEASE CUST
@ 1,0 SAY 'WHAT IS THE NAME OF THE CUSTOMER FIRST PART ONLY '
ACCEPT TO CUST
STORE !(CUST) TO CUST
FIND &CUST
IF #=0
? 'CUSTOMER NOT FOUND'
? 'IS CUSTOMER DATA CORRECT??? PRESS ANY KEY TO CONTINUE'
WAIT
LOOP
ENDIF
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,25 GET ACCNUMA
@ 4,0 SAY ' STREET '
@ 4,25 GET STREETA
@ 5,0 SAY ' CITY POSTCODE '
@ 5,25 GET CITYPCA
@ 6,0 SAY ' CONTACT '
@ 6,25 GET CONTACTA
@ 7,0 SAY 'DATE LAST AMENDED'
@ 7,20 SAY DATEA
@ 8,0 SAY ' DISCOUNT ALLOWED ON TRANSACTIONS '
@ 8,40 GET DISCOUNTA
@ 9,0 SAY ' SALES TAX NUMBER IF APPLICABLE '
@ 9,36 GET TAXNUMA
@ 10,0 SAY ' ARE THE GOODS TO BE PURCHASED FOR RESALE T=TRUE' 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 ' AMEND 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 ='LEDGER' .OR. FILE='DATAFILE'
STORE 1 TO ITEM:NUMA
@ 18,0 SAY 'WHAT IS INVOICE NUMBER TO LOCATE AND EDIT' GET INV PICT '99999'
IF FILE='DATAFILE'
@ 19,0 SAY 'LINE NUMBER' GET ITEM:NUMA PICT '999'
ENDIF
READ
ENDIF
IF FILE='DATAFILE'
LOCATE FOR INVNUM=INV .AND. ITEM:NUM=ITEM:NUMA
ENDIF
IF FILE='LEDGER'
LOCATE FOR NUM=INV
ENDIF
STORE # TO OPTION
STORE ' ' TO DEC2
*********************
IF DEC2=' '
IF FILE ='LEDGER' .OR. FILE='DATAFILE'
EDIT OPTION
ENDIF
ERASE
@ 12,0 SAY'PRESS RETURN TO PREVIOUS MENU TO EDIT ANOTHER RECORD'
@ 14,0 SAY'PRESS "E" KEY TO REINDEX THE RECORDS EDITED SO FAR 'GET DEC2
READ
IF DEC2=' '
LOOP
ENDIF
**********************************
IF FILE='PRICELIS INDEX PRICECOD' .OR. FILE='NAMELIST INDEX NAME'
REINDEX
ENDIF
ENDDO
RETURN
FOUND TRY AGAIN'
WAIT
LOO