tldm-universe/CMS/BP.CLOCK/CLOCKTABLE.DEPT
2024-09-10 15:25:06 -04:00

95 lines
2.0 KiB
Plaintext
Executable File

*--------------------------*
* TABLE
* GENERIC TABLE MAINTENANCE PROGRAM TO UPDATE CLOCK TABLES.
*--------------------------*
CS=@(-1) ; CR=@(-3) ; CL=@(-4) ; RV=@(-13) ; ERV=@(-14)
VM=CHAR(253) ; SVM=CHAR(252) ; AM=CHAR(254) ; BEEP=CHAR(7)
PF1='<' ; PF2='P' ; PF3='/'
PROMPT ""
*
LAYOUT='1'
LAYOUT<2>='DEPT DESC'
LAYOUT<3>='Enter the DEPARTMENT description'
FILENAME='DEPT'
OPEN FILENAME TO OFILE ELSE ABORT
10 *
CRT CS
CRT @(0,0):"CLOCKTABLE.DEPT"
STRING=FILENAME:" MAINTENANCE"
CENTER=40-INT(LEN(STRING)/2)
XCT=DCOUNT(LAYOUT<1>,VM)
OLD.LEN=0
FOR X=1 TO XCT
XLEN=LEN(LAYOUT<2,X>)
IF XLEN > OLD.LEN THEN OLD.LEN=XLEN
NEXT X
XLEN=OLD.LEN
CRT @(CENTER,3):RV:STRING:ERV
STRING=FILENAME
CRT @(0,22):CL:"Enter ":FILENAME:" code '/' to escape"
CRT @(CENTER,6):CL:STRING:" ":
CENTER=CENTER-5
INPUT KEY
IF KEY='/' OR KEY='' THEN STOP
READ IREC FROM OFILE,KEY THEN
GOSUB 2000
OREC=IREC
END ELSE
CRT @(0,22):CL:FILENAME:" record not found - 'A'(add)":
INPUT ANS
IF ANS = 'A' THEN
IREC=''
OREC=''
GOSUB 2000
GOSUB 1000
END ELSE
GO 10
END
END
GOSUB 3000
GO 10
1000 *
ACT=DCOUNT(LAYOUT<1>,VM)
FOR A=1 TO ACT
ALEN=LEN(LAYOUT<2,A>)
CRT @(0,22):CL:LAYOUT<3,A>:
CRT @(CENTER,7+A):A:" ":LAYOUT<2,A>:STR(" ",XLEN-ALEN):": ":
INPUT ANS
IF ANS # '' THEN
OREC<A>=ANS
END
NEXT A
RETURN
2000 *
ACT=DCOUNT(LAYOUT<1>,VM)
FOR A=1 TO ACT
ALEN=LEN(LAYOUT<2,A>)
CRT @(CENTER,7+A):A:" ":LAYOUT<2,A>:STR(" ",XLEN-ALEN):": ":IREC<A>
NEXT A
RETURN
3000 *
CRT @(0,22):CL:"Enter # change, 'E'(end) else RETURN ":
INPUT A
IF A='E' THEN GOSUB 4000; GO 10
IF A >=1 AND A <=ACT THEN
ALEN=LEN(LAYOUT<2,A>)
CRT @(0,22):CL:LAYOUT<3,A>:
CRT @(CENTER,7+A):A:" ":LAYOUT<2,A>:STR(" ",XLEN-ALEN):": ":OREC<A>:CL
CRT @(CENTER,7+A):A:" ":LAYOUT<2,A>:STR(" ",XLEN-ALEN):": ":
INPUT ANS
IF ANS # '' THEN
OREC<A>=ANS
END
CRT @(CENTER,7+A):A:" ":LAYOUT<2,A>:STR(" ",XLEN-ALEN):": ":OREC<A>:CL
GO 3000
END
CRT @(0,22):CL:"NO SELECTION MADE":
RQM
GO 10
RETURN
4000 *
WRITE OREC ON OFILE,KEY
CRT @(0,22):CL:"RECORD UPDATED":
RQM
RETURN