home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Media Share 9
/
MEDIASHARE_09.ISO
/
clarion
/
multiadd.zip
/
MULTIADD.COM
/
ROUTE12.CLA
< prev
Wrap
Text File
|
1989-06-30
|
24KB
|
594 lines
MEMBER('ROUTE')
WIP_FORM PROCEDURE
SCREEN SCREEN WINDOW(25,44),AT(1,34),PRE(SCR),HUE(15,1,11)
OMIT('**-END-**')
╔══════════════════════════════════════════╗
║ Labor Ticket File ║
║ ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ ║
║ ║
║ Lot# :■■■■■■ Date :mm/dd/yy ║
║ Part# :■■■■■ ║
║ Dept# :## (■■■■■■■■■■■■■■■ ) ║
║ Oper# :### (■■■■■■■■■■■■■■■■■) ║
║ Accept :<<# Rework :<<# Scrap :<<# ║
║ ╔══════════════════════════════════════╗ ║
║ ║ Out(hh:mmXM) - In(hh:mmXM) = (<<#.##)║ ║
║ ╠════════════╤════════════╤════════════╣ ║
║ ║ Out :##:## │ Out :##:## │ Out :##:## ║ ║
║ ║ In :##:## │ In :##:## │ In :##:## ║ ║
║ ╟────────────┼────────────┼────────────╢ ║
║ ║ Out :##:## │ Out :##:## │ Out :##:## ║ ║
║ ║ In :##:## │ In :##:## │ In :##:## ║ ║
║ ╟────────────┼────────────┼────────────╢ ║
║ ║ Out :##:## │ Out :##:## │ Out :##:## ║ ║
║ ║ In :##:## │ In :##:## │ In :##:## ║ ║
║ ╚════════════╧════════════╧════════════╝ ║
║ Total Time :<<#.## Sample Lot :■ ║
║ Clk# :### (■■■■■■■■■■■■■■■■■) Shft# :# ║
║ Enter to Save, Esc to Edit... ║
╚══════════════════════════════════════════╝
**-END-**
ROW(10,3) PAINT(11,1),HUE(11,1)
ROW(21,3) PAINT(1,39),HUE(11,1)
ROW(11,42) PAINT(11,1),HUE(11,1)
ROW(10,4) PAINT(1,39),HUE(11,1)
ROW(12,4) PAINT(1,39),HUE(11,1)
ROW(15,2) PAINT(1,41),HUE(11,1)
ROW(18,4) PAINT(1,39),HUE(11,1)
ROW(12,29) PAINT(10,1),HUE(11,1)
ROW(12,16) PAINT(9,1),HUE(11,1)
ROW(5,4) PAINT(5,8),HUE(14,1)
ROW(11,5) PAINT(1,1),HUE(11,1)
ROW(1,1) STRING('<201,205{42},187>')
ROW(2,1) REPEAT(23);STRING('<186,0{42},186>') .
ROW(25,1) STRING('<200,205{42},188>')
ROW(10,3) STRING('<201,205{38},187>')
ROW(11,3) STRING('<186,0{38},186>')
ROW(12,3) STRING('<204,205{12},209,205{12},209,205{12},185>')
ROW(13,3) REPEAT(3),EVERY(3);STRING('<186,0{12},179,0{12},179,0{12},186>') .
ROW(14,3) REPEAT(3),EVERY(3);STRING('<186,0{12},179,0{12},179,0{12},186>') .
ROW(15,3) REPEAT(2),EVERY(3);STRING('<199,196{12},197,196{12},197,196{12},182>') .
ROW(21,3) STRING('<200,205{12},207,205{12},207,205{12},188>')
ROW(2,15) STRING('Labor Ticket File')
ROW(5,4) STRING('Lot#')
COL(10) STRING(' '),HUE(15,1)
COL(22) STRING(' {5}'),HUE(15,1)
COL(27) STRING(' Date'),HUE(14,1)
COL(32) STRING(' '),HUE(15,1)
ROW(6,4) STRING('Part#')
COL(10) STRING(' '),HUE(15,1)
ROW(7,4) STRING('Dept#')
COL(10) STRING(' '),HUE(15,1)
COL(20) STRING(' '),HUE(15,1)
COL(22) STRING(' '),HUE(11,1)
COL(23) STRING('(')
COL(39) STRING(' '),HUE(15,1)
COL(41) STRING(')')
ROW(8,4) STRING('Oper#')
COL(10) STRING(' '),HUE(15,1)
COL(20) STRING(' '),HUE(15,1)
COL(22) STRING(' '),HUE(11,1)
COL(23) STRING('(')
COL(41) STRING(')')
ROW(9,4) STRING('Accept'),HUE(14,1)
COL(10) STRING(' '),HUE(15,1)
COL(17) STRING(' '),HUE(15,1)
COL(29) STRING(' '),HUE(15,1)
ROW(11,5) STRING('O'),HUE(11,1)
COL(6) STRING('ut('),HUE(11,1)
COL(16) STRING(')'),HUE(11,1)
COL(17) STRING(' '),HUE(15,1)
COL(18) STRING('- In('),HUE(11,1)
COL(30) STRING(')'),HUE(11,1)
COL(31) STRING(' '),HUE(15,1)
COL(32) STRING('= ('),HUE(11,1)
COL(41) STRING(')'),HUE(11,1)
ROW(22,21) STRING(' {7}'),HUE(15,1)
COL(28) STRING(' Sample Lot'),HUE(14,1)
COL(39) STRING(' '),HUE(15,1)
ROW(23,3) STRING('Clk#'),HUE(14,1)
COL(13) STRING('(')
COL(31) STRING(')')
COL(33) STRING(' Shft#'),HUE(14,1)
MESSAGE ROW(3,8) STRING(30),HUE(10,1)
DEPTNAME ROW(7,24) STRING(15),HUE(10,1)
OPERNAME ROW(8,24) STRING(17),HUE(10,1)
EMPNAME ROW(23,14) STRING(17),HUE(10,1)
TIME_OUT ROW(11,9) STRING(@T3),HUE(10,1)
TIME_IN COL(23) STRING(@T3),HUE(10,1)
TIME COL(35) STRING(@N6.2),HUE(10,1)
ROW(7,35) ENTRY,USE(?FIRST_FIELD)
ROW(5,11) STRING(':')
COL(12) ENTRY(@S6),USE(WIP:LOTNBR),NUM,LFT,UPR
COL(33) STRING(':'),HUE(14,1)
COL(34) ENTRY(@D1),USE(WIP:WORK_DATE),INS,NUM
ROW(6,11) STRING(':')
COL(12) ENTRY(@S5),USE(WIP:PARTNBR),NUM,LFT,UPR
ROW(7,11) STRING(':')
COL(12) ENTRY(@N02),USE(WIP:DEPTNBR),INS,NUM
ROW(8,11) STRING(':')
COL(12) ENTRY(@N03),USE(WIP:OPERNBR),INS,NUM
ROW(9,11) STRING(':')
COL(12) ENTRY(@N3),USE(WIP:ACC_QTY),INS,NUM
COL(18) STRING('Rework :'),HUE(14,1)
COL(26) ENTRY(@N3),USE(WIP:RWK_QTY),INS,NUM
COL(32) STRING('Scrap :'),HUE(14,1)
COL(39) ENTRY(@N3),USE(WIP:SCRAP_QTY),INS,NUM
ROW(13,5) STRING('Out :'),HUE(14,1)
COL(10) ENTRY(@P##:##P),USE(SAV:ENDTIME1),INS,NUM
ROW(14,5) STRING('In :'),HUE(14,1)
COL(10) ENTRY(@P##:##P),USE(SAV:BEGTIME1),INS,NUM
ROW(16,5) STRING('Out :'),HUE(14,1)
COL(10) ENTRY(@P##:##P),USE(SAV:ENDTIME2),INS,NUM
ROW(17,5) STRING('In :'),HUE(14,1)
COL(10) ENTRY(@P##:##P),USE(SAV:BEGTIME2),INS,NUM
ROW(19,5) STRING('Out :'),HUE(14,1)
COL(10) ENTRY(@P##:##P),USE(SAV:ENDTIME3),INS,NUM
ROW(20,5) STRING('In :'),HUE(14,1)
COL(10) ENTRY(@P##:##P),USE(SAV:BEGTIME3),INS,NUM
ROW(13,18) STRING('Out :'),HUE(14,1)
COL(23) ENTRY(@P##:##P),USE(SAV:ENDTIME4),INS,NUM
ROW(14,18) STRING('In :'),HUE(14,1)
COL(23) ENTRY(@P##:##P),USE(SAV:BEGTIME4),INS,NUM
ROW(16,18) STRING('Out :'),HUE(14,1)
COL(23) ENTRY(@P##:##P),USE(SAV:ENDTIME5),INS,NUM
ROW(17,18) STRING('In :'),HUE(14,1)
COL(23) ENTRY(@P##:##P),USE(SAV:BEGTIME5),INS,NUM
ROW(19,18) STRING('Out :'),HUE(14,1)
COL(23) ENTRY(@P##:##P),USE(SAV:ENDTIME6),INS,NUM
ROW(20,18) STRING('In :'),HUE(14,1)
COL(23) ENTRY(@P##:##P),USE(SAV:BEGTIME6),INS,NUM
ROW(13,31) STRING('Out :'),HUE(14,1)
COL(36) ENTRY(@P##:##P),USE(SAV:ENDTIME7),INS,NUM
ROW(14,31) STRING('In :'),HUE(14,1)
COL(36) ENTRY(@P##:##P),USE(SAV:BEGTIME7),INS,NUM
ROW(16,31) STRING('Out :'),HUE(14,1)
COL(36) ENTRY(@P##:##P),USE(SAV:ENDTIME8),INS,NUM
ROW(17,31) STRING('In :'),HUE(14,1)
COL(36) ENTRY(@P##:##P),USE(SAV:BEGTIME8),INS,NUM
ROW(19,31) STRING('Out :'),HUE(14,1)
COL(36) ENTRY(@P##:##P),USE(SAV:ENDTIME9),INS,NUM
ROW(20,31) STRING('In :'),HUE(14,1)
COL(36) ENTRY(@P##:##P),USE(SAV:BEGTIME9),INS,NUM
ROW(22,3) STRING('Total Time :'),HUE(14,1)
COL(15) ENTRY(@N6.2),USE(WIP:TOTAL_TIME),INS,NUM
COL(40) STRING(':'),HUE(14,1)
COL(41) ENTRY(@S1),USE(WIP:SAMPLE),UPR
ROW(23,8) STRING(':'),HUE(14,1)
COL(9) ENTRY(@N03),USE(WIP:CLOCKNBR),INS,NUM
COL(40) STRING(':'),HUE(14,1)
COL(41) ENTRY(@N1),USE(WIP:SHIFT),INS,NUM
ROW(24,14) PAUSE('Enter to Save, Esc to Edit...'),USE(?PAUSE_FIELD),HUE(31,1)
ROW(19,37) ENTRY,USE(?LAST_FIELD)
COL(37) PAUSE(''),USE(?DELETE_FIELD)
.
SAVE_RECORD GROUP;BYTE,DIM(SIZE(WIP:RECORD)).
PROD_TIME GROUP,PRE(SAV)
ENDTIME DECIMAL(5) !Saved End Production Time
BEGTIME DECIMAL(5) !Saved Beg Production Time
ENDTIME1 DECIMAL(5) !End Production Time
BEGTIME1 DECIMAL(5) !Beg Production Time
ENDTIME2 DECIMAL(5) !End Production Time
BEGTIME2 DECIMAL(5) !Beg Production Time
ENDTIME3 DECIMAL(5) !End Production Time
BEGTIME3 DECIMAL(5) !Beg Production Time
ENDTIME4 DECIMAL(5) !End Production Time
BEGTIME4 DECIMAL(5) !Beg Production Time
ENDTIME5 DECIMAL(5) !End Production Time
BEGTIME5 DECIMAL(5) !Beg Production Time
ENDTIME6 DECIMAL(5) !End Production Time
BEGTIME6 DECIMAL(5) !Beg Production Time
ENDTIME7 DECIMAL(5) !End Production Time
BEGTIME7 DECIMAL(5) !Beg Production Time
ENDTIME8 DECIMAL(5) !End Production Time
BEGTIME8 DECIMAL(5) !Beg Production Time
ENDTIME9 DECIMAL(5) !End Production Time
BEGTIME9 DECIMAL(5) !Beg Production Time
.
EJECT
CODE
OPEN(SCREEN) !OPEN THE SCREEN
SETCURSOR !TURN OFF ANY CURSOR
SAVE_RECORD = WIP:RECORD !SAVE THE ORIGINAL
CLEAR(PROD_TIME) !Clear Prod Time Variables
IF ACTION = 1 !ON ADD, DISPLAY DEFAULT
WIP:WORK_DATE = MEM:ANYDATE ! Production Work Date
WIP:SHIFT = 1 ! Default Value
POINTER# = 0 ! NO RECORD FOR ADD
.
IF ACTION = 2 THEN POINTER# = POINTER(WIP). !CURRENT RECORD FOR CHANGE
IF ACTION = 2 OR ACTION = 3 !IF CHANGING OR DELETING RECORD
DO SHOW_OPER ! DISPLAY OPER & DEPT NAMES
DO SHOW_EMP ! DISPLAY EMPLOYEE NAME
.
DISPLAY !DISPLAY THE FIELDS
LOOP !LOOP THRU ALL THE FIELDS
MEM:MESSAGE = CENTER(MEM:MESSAGE,SIZE(MEM:MESSAGE)) !DISPLAY ACTION MESSAGE
SCR:MESSAGE = MEM:MESSAGE
ALERT !RESET ALERTED KEYS
ALERT(ACCEPT_KEY) !ALERT SCREEN ACCEPT KEY
ALERT(REJECT_KEY) !ALERT SCREEN REJECT KEY
IF ACTION = 1 THEN DO CALC_TIME. !ON ADD, CALCULATE FIELD VALUE
ACCEPT !READ A FIELD
IF KEYCODE() = REJECT_KEY !ON SCREEN REJECT KEY
IF ACTION = 1 THEN ACTION = 0. ! SET ADD ACTION TO COMPLETE
RETURN ! RETURN
.
EXECUTE ACTION !SET ACTION MESSAGE
MEM:MESSAGE = 'Labor Ticket will be Added' !
MEM:MESSAGE = 'Labor Ticket will be Changed'!
MEM:MESSAGE = 'Enter to Delete, Esc to Exit'!
.
EDIT_RANGE# = FIELD() !SET ONE FIELD EDIT RANGE
IF KEYCODE() = ACCEPT_KEY !ON SCREEN ACCEPT KEY
UPDATE ! MOVE ALL FIELDS FROM SCREEN
EDIT_RANGE# = FIELDS() ! AND EDIT REMAINING FIELDS
. !
LOOP FIELD# = FIELD() TO EDIT_RANGE# !EDIT FIELDS IN THE EDIT RANGE
CASE FIELD# !JUMP TO FIELD EDIT ROUTINE
OF ?FIRST_FIELD !FROM THE FIRST FIELD
IF KEYCODE() = ESC_KEY ! ON ESC KEY
IF ACTION = 1 THEN ACTION = 0. ! SET ADD ACTION TO COMPLETE
RETURN ! AND RETURN
.
IF ACTION = 3 THEN SELECT(?DELETE_FIELD).! OR CONFIRM FOR DELETE
OF ?WIP:LOTNBR !Production Lot Number
IF WIP:LOTNBR = '' !IF REQUIRED FIELD IS BLANK
BEEP(500,32) ! SOUND KEYBOARD ALARM
MEM:MESSAGE = 'Field is Required!' ! MOVE AN ERROR MESSAGE
SELECT(?WIP:LOTNBR) ! AND STAY ON THIS FIELD
BREAK !
.
IF ACTION = 1 !If adding a record
LOTNBR# = WIP:LOTNBR ! Save Entered Lot#
WIP:DEPTNBR = 99 ! Set Key Field to last
WIP:OPERNBR = 999 ! entry in desired region
SET(WIP:LOT_KEY,WIP:LOT_KEY) ! and get the
PREVIOUS(WIP) ! previous record
IF WIP:LOTNBR = LOTNBR# ! If there is a match
DISPLAY(?WIP:SAMPLE) ! display lookup field
DISPLAY(?WIP:ACC_QTY) ! display lookup field
IND:SEQNBR = WIP:SEQNBR ! equal to closest values in
ELSE
IND:SEQNBR = 0
WIP:SAMPLE = 'N' ! Default Value
.
IND:ITEMNBR = WIP:PARTNBR ! set fields in lookup file
SET(IND:ITEMDTL_KEY,IND:ITEMDTL_KEY) ! current record
NEXT(INVDFILE) ! Get next record
IF IND:ITEMNBR <> WIP:PARTNBR THEN BREAK. ! If linking fields do not match then break
WIP:DEPTNBR = IND:DEPTNBR ! then move the
WIP:OPERNBR = IND:OPERNBR ! lookups fields
DO SHOW_OPER ! plus their associated names
DISPLAY(?WIP:PARTNBR,?WIP:OPERNBR) !display the fields
DISPLAY(?WIP:SAMPLE)
.
OF ?WIP:WORK_DATE !Production Work Date
IF MEM:ANYDATE <> WIP:WORK_DATE !If entry is different than save field
MEM:ANYDATE = WIP:WORK_DATE ! then update save field to current entry
.
OF ?WIP:PARTNBR !Part Number
INH:ITEMNBR = WIP:PARTNBR !MOVE RELATED FIELDS
GET(INVHFILE,INH:INVHNBR_KEY) !READ THE RECORD
IF ERROR() !IF NO RECORD IS FOUND
ACTION# = ACTION ! SAVE ACTION
ACTION = 4 ! REQUEST TABLE LOOKUP
INV_TABLE ! CALL LOOKUP PROCEDURE
WIP:PARTNBR = INH:ITEMNBR ! MOVE LOOKUP FIELD
DISPLAY(?WIP:PARTNBR) ! AND DISPLAY IT
IF ACTION THEN SELECT(?WIP:PARTNBR). ! NO SELECTION WAS MADE
ACTION = ACTION# ! RESTORE ACTION
.
OF ?WIP:DEPTNBR !Department Number
OF ?WIP:OPERNBR !Operation Number
OPR:DEPTNBR = WIP:DEPTNBR !MOVE RELATED FIELDS
OPR:OPERNBR = WIP:OPERNBR !MOVE RELATED FIELDS
GET(OPERFILE,OPR:DEPTOPER_KEY) !READ THE RECORD
IF ERROR() !IF NO RECORD IS FOUND
ACTION# = ACTION ! SAVE ACTION
ACTION = 4 ! REQUEST TABLE LOOKUP
OPER_DIR ! CALL LOOKUP PROCEDURE
WIP:DEPTNBR = OPR:DEPTNBR ! MOVE LOOKUP FIELD
WIP:OPERNBR = OPR:OPERNBR ! MOVE LOOKUP FIELD
DISPLAY(?WIP:DEPTNBR) ! AND DISPLAY IT
DISPLAY(?WIP:OPERNBR) ! AND DISPLAY IT
IF ACTION THEN SELECT(?WIP:DEPTNBR). ! NO SELECTION WAS MADE
ACTION = ACTION# ! RESTORE ACTION
.
SCR:DEPTNAME = OPR:DEPTNAME
SCR:OPERNAME = OPR:OPERDESC
IF OPR:LBR_TYPE = 'I'
BEEP
MEM:MESSAGE = 'Indirect Labor Operation'! MOVE A MESSAGE
.
GET(WIP,WIP:LOT_KEY) !READ THE RECORD BY KEY
IF NOT ERROR() !IF A RECORD IS FOUND
IF POINTER(WIP) <> POINTER# ! BUT NOT THE SAME RECORD
CLEAR(WIP:RECORD) ! CLEAR IN CASE OF ADD
GET(WIP,POINTER#) ! RE-READ THE OLD RECORD
UPDATE ! RE-UPDATE THE RECORD
MEM:MESSAGE = 'Creates Duplicate Labor Ticket'! MOVE AN ERROR MESSAGE
SELECT(?WIP:OPERNBR) ! STAY ON THE SAME FIELD
BEEP(500,32) !* SOUND KEYBOARD ALARM
BREAK ! AND LOOP AGAIN
. .
GET(WIP,POINTER#) ! RE-READ THE OLD RECORD
UPDATE ! AND RE-UPDATE THE RECORD
OF ?WIP:ACC_QTY !Good Quantity
OF ?WIP:RWK_QTY !Rework Quantity
OF ?WIP:SCRAP_QTY !Scrap Quantity
IF WIP:SCRAP_QTY > WIP:ACC_QTY
BEEP(500,32) ! SOUND KEYBOARD ALARM
MEM:MESSAGE = 'Scrap Qty S/B <<= Accept Qty' !* MOVE AN ERROR MESSAGE
SELECT(?WIP:SCRAP_QTY) ! AND STAY ON THIS FIELD
BREAK !
.
OF ?SAV:ENDTIME1 !Production Stop Time
SAV:ENDTIME = SAV:ENDTIME1 !Save Entry Value
DO EDIT_ENDTIME !Call Edit Routine
OF ?SAV:BEGTIME1 !Production Start Time
SAV:ENDTIME = SAV:ENDTIME1 !Save Entry Value
SAV:BEGTIME = SAV:BEGTIME1 !Save Entry Value
DO EDIT_BEGTIME !Call Edit Routine
IF SEL_FLG# !If Select Flag On
SELECT(?SAV:BEGTIME1) ! Stay on Same Field
BREAK ! and Break out of edit loop
.
OF ?SAV:ENDTIME2 !Production Stop Time
SAV:ENDTIME = SAV:ENDTIME2 !Save Entry Value
DO EDIT_ENDTIME !Call Edit Routine
OF ?SAV:BEGTIME2 !Production Start Time
SAV:ENDTIME = SAV:ENDTIME2 !Save Entry Value
SAV:BEGTIME = SAV:BEGTIME2 !Save Entry Value
DO EDIT_BEGTIME !Call Edit Routine
IF SEL_FLG# !If Select Flag On
SELECT(?SAV:BEGTIME2) ! Stay on Same Field
BREAK ! and Break out of edit loop
.
OF ?SAV:ENDTIME3 !Production Stop Time
SAV:ENDTIME = SAV:ENDTIME3 !Save Entry Value
DO EDIT_ENDTIME !Call Edit Routine
OF ?SAV:BEGTIME3 !Production Start Time
SAV:ENDTIME = SAV:ENDTIME3 !Save Entry Value
SAV:BEGTIME = SAV:BEGTIME3 !Save Entry Value
DO EDIT_BEGTIME !Call Edit Routine
IF SEL_FLG# !If Select Flag On
SELECT(?SAV:BEGTIME3) ! Stay on Same Field
BREAK ! and Break out of edit loop
.
OF ?SAV:ENDTIME4 !Production Stop Time
SAV:ENDTIME = SAV:ENDTIME4 !Save Entry Value
DO EDIT_ENDTIME !Call Edit Routine
OF ?SAV:BEGTIME4 !Production Start Time
SAV:ENDTIME = SAV:ENDTIME4 !Save Entry Value
SAV:BEGTIME = SAV:BEGTIME4 !Save Entry Value
DO EDIT_BEGTIME !Call Edit Routine
IF SEL_FLG# !If Select Flag On
SELECT(?SAV:BEGTIME4) ! Stay on Same Field
BREAK ! and Break out of edit loop
.
OF ?SAV:ENDTIME5 !Production Stop Time
SAV:ENDTIME = SAV:ENDTIME5 !Save Entry Value
DO EDIT_ENDTIME !Call Edit Routine
OF ?SAV:BEGTIME5 !Production Start Time
SAV:ENDTIME = SAV:ENDTIME5 !Save Entry Value
SAV:BEGTIME = SAV:BEGTIME5 !Save Entry Value
DO EDIT_BEGTIME !Call Edit Routine
IF SEL_FLG# !If Select Flag On
SELECT(?SAV:BEGTIME5) ! Stay on Same Field
BREAK ! and Break out of edit loop
.
OF ?SAV:ENDTIME6 !Production Stop Time
SAV:ENDTIME = SAV:ENDTIME6 !Save Entry Value
DO EDIT_ENDTIME !Call Edit Routine
OF ?SAV:BEGTIME6 !Production Start Time
SAV:ENDTIME = SAV:ENDTIME6 !Save Entry Value
SAV:BEGTIME = SAV:BEGTIME6 !Save Entry Value
DO EDIT_BEGTIME !Call Edit Routine
IF SEL_FLG# !If Select Flag On
SELECT(?SAV:BEGTIME6) ! Stay on Same Field
BREAK ! and Break out of edit loop
.
OF ?SAV:ENDTIME7 !Production Stop Time
SAV:ENDTIME = SAV:ENDTIME7 !Save Entry Value
DO EDIT_ENDTIME !Call Edit Routine
OF ?SAV:BEGTIME7 !Production Start Time
SAV:ENDTIME = SAV:ENDTIME7 !Save Entry Value
SAV:BEGTIME = SAV:BEGTIME7 !Save Entry Value
DO EDIT_BEGTIME !Call Edit Routine
IF SEL_FLG# !If Select Flag On
SELECT(?SAV:BEGTIME7) ! Stay on Same Field
BREAK ! and Break out of edit loop
.
OF ?SAV:ENDTIME8 !Production Stop Time
SAV:ENDTIME = SAV:ENDTIME8 !Save Entry Value
DO EDIT_ENDTIME !Call Edit Routine
OF ?SAV:BEGTIME8 !Production Start Time
SAV:ENDTIME = SAV:ENDTIME8 !Save Entry Value
SAV:BEGTIME = SAV:BEGTIME8 !Save Entry Value
DO EDIT_BEGTIME !Call Edit Routine
IF SEL_FLG# !If Select Flag On
SELECT(?SAV:BEGTIME8) ! Stay on Same Field
BREAK ! and Break out of edit loop
.
OF ?SAV:ENDTIME9 !Production Stop Time
SAV:ENDTIME = SAV:ENDTIME9 !Save Entry Value
DO EDIT_ENDTIME !Call Edit Routine
OF ?SAV:BEGTIME9 !Production Start Time
SAV:ENDTIME = SAV:ENDTIME9 !Save Entry Value
SAV:BEGTIME = SAV:BEGTIME9 !Save Entry Value
DO EDIT_BEGTIME !Call Edit Routine
IF SEL_FLG# !If Select Flag On
SELECT(?SAV:BEGTIME9) ! Stay on Same Field
BREAK ! and Break out of edit loop
.
OF ?WIP:TOTAL_TIME !Total Prod Time
IF ACTION = 1 THEN DO CALC_TIME.
OF ?WIP:SAMPLE !Sample Lot Y=Yes N=No
IF WIP:SAMPLE <> 'Y' AND | !IF FIELD IS OUT OF RANGE
WIP:SAMPLE <> 'N' !IF FIELD IS OUT OF RANGE
BEEP(500,32) ! SOUND KEYBOARD ALARM
MEM:MESSAGE = 'Sample Lot: Y=Yes or N=No' !* MOVE AN ERROR MESSAGE
SELECT(?WIP:SAMPLE) ! AND STAY ON THIS FIELD
BREAK !
.
OF ?WIP:CLOCKNBR !Employee Clock Number
!SCR:EMPNAME = EMPLOYEE NAME
OF ?WIP:SHIFT !Production Work Shift
IF ~INRANGE(WIP:SHIFT,1,3) !IF FIELD IS OUT OF RANGE
BEEP(500,32) ! SOUND KEYBOARD ALARM
MEM:MESSAGE = 'Shift# Must Be 1 or 2 or 3' !* MOVE AN ERROR MESSAGE
SELECT(?WIP:SHIFT) ! AND STAY ON THIS FIELD
BREAK !
.
OF ?PAUSE_FIELD !ON PAUSE FIELD
IF KEYCODE() <> ENTER_KEY | !IF NOT ENTER KEY
AND KEYCODE() <> ACCEPT_KEY !AND NOT CTRL-ENTER KEY
BEEP(500,32) !* ALERT USER TO ERROR
MEM:MESSAGE = 'Invalid Key Pressed' !* DISPLAY ERROR MESSAGE
SELECT(?PAUSE_FIELD) ! AND STAY ON PAUSE FIELD
.
OF ?LAST_FIELD !FROM THE LAST FIELD
IF ACTION = 2 !IF UPDATEING RECORD
HOLD(WIP) ! HOLD FILE
GET(WIP,POINTER#) ! RE-READ SAME RECORD
IF ERRORCODE() = 35 ! IF RECORD WAS DELETED
ACTION = 1 ! THEN ADD IT BACK
ELSIF | ! IF IT HAS BEEN CHANGED
WIP:RECORD <> SAVE_RECORD ! BY ANOTHER STATION
MEM:MESSAGE = 'Changed By Another Station' !INFORM USER
SELECT(2) ! GO BACK TO FIELD 1
BEEP ! SOUND ALARM
RELEASE(WIP) ! RELEASE FILE
SAVE_RECORD = WIP:RECORD ! SAVE RECORD
DISPLAY ! DISPLAY THE FIELDS
BREAK ! AND CONTINUE
.
UPDATE !UPDATE FROM SCREEN TO RECORD
.
WIP:SEQNBR = IND:SEQNBR ! SAVE HIDDEN LOOKUP FIELD
EXECUTE ACTION ! UPDATE THE FILE
ADD(WIP) ! ADD NEW RECORD
PUT(WIP) ! CHANGE EXISTING RECORD
DELETE(WIP) ! DELETE EXISTING RECORD
.
IF ERROR() ! CHECK FOR UNEXPECTED ERROR
GBL:DISK_ERROR = FILE_ERR() ! DISPLAY ERROR WINDOW
STOP(ERROR()) ! STOP PROGRAM
. !
SAVE_RECORD = WIP:RECORD ! NEW ORIGINAL
IF ACTION <> 1 !*IF CHANGE/DELETE RECORD
ACTION = 0 !* SET ACTION TO COMPLETE
RETURN !* AND RETURN TO CALLER
ELSE !*ELSE IF ADDING A RECORD
POINTER# = POINTER(WIP) !* POINT TO RECORD
ACTION = 1 !* SET ACTION TO ADD
RETURN !* AND RETURN TO CALLER
.
OF ?DELETE_FIELD !FROM THE DELETE FIELD
GBL:OK_TO_DEL = DEL_SCR() ! DISPLAY DELETE CONFIRMATION WINDOW
IF GBL:OK_TO_DEL ! IF OK TO DELETE
SELECT(?LAST_FIELD) ! DELETE THE RECORD
ELSE ! OTHERWISE
RETURN ! RETURN TO CALLING PROGRAM
. . . .
EDIT_ENDTIME ROUTINE !End Time Edit Routine
SCR:TIME_OUT = SAV:ENDTIME * 3600 !Convert to Std Time
IF ~INRANGE(SAV:BEGTIME,0,2399) !IF ENTRY OUT OF RANGE
BEEP(500,32) ! SOUND KEYBOARD ALARM
MEM:MESSAGE = 'Invalid Time!' ! MOVE AN ERROR MESSAGE
SEL_FLG# = 1 ! AND STAY ON THIS FIELD
EXIT ! EXIT EDIT ROUTINE
.
EDIT_BEGTIME ROUTINE !Beg Time Edit Routine
SEL_FLG# = 0 !Turn Select Flag Off
SCR:TIME_IN = SAV:BEGTIME * 3600 !Convert to Std Time
IF SAV:BEGTIME = 0 AND SAV:ENDTIME = 0 !Bypass entry if no input
SELECT(?WIP:TOTAL_TIME) ! Select Next Input Field
EXIT ! Exit Routine
.
IF ~INRANGE(SAV:ENDTIME,0,2399) !IF ENTRY OUT OF RANGE
BEEP(500,32) ! SOUND KEYBOARD ALARM
MEM:MESSAGE = 'Invalid Time!' ! MOVE AN ERROR MESSAGE
SEL_FLG# = 1 ! AND STAY ON THIS FIELD
EXIT ! EXIT EDIT ROUTINE
.
IF SAV:ENDTIME <> 0 !If End Time was entered
IF SAV:BEGTIME = 0 !but not Beg Time
BEEP(500,32) ! SOUND KEYBOARD ALARM
MEM:MESSAGE = 'Time-In is Required!' ! MOVE AN ERROR MESSAGE
SEL_FLG# = 1 ! AND STAY ON THIS FIELD
EXIT ! EXIT EDIT ROUTINE
. .
IF SAV:BEGTIME > SAV:ENDTIME !If not valid range
BEEP(500,32) ! SOUND KEYBOARD ALARM
MEM:MESSAGE = 'Time In S/B >= Time Out' ! MOVE AN ERROR MESSAGE
SEL_FLG# = 1 ! AND STAY ON THIS FIELD
EXIT ! EXIT EDIT ROUTINE
.
SCR:TIME = ((SAV:ENDTIME - SAV:BEGTIME)/100) !Display Prod Times
SHOW_OPER ROUTINE !Display Lookup Fields
OPR:DEPTNBR = WIP:DEPTNBR !MOVE RELATED FIELDS
OPR:OPERNBR = WIP:OPERNBR !MOVE RELATED FIELDS
GET(OPERFILE,OPR:DEPTOPER_KEY) !READ THE RECORD
IF ~ERROR() !IF A RECORD IS FOUND
SCR:DEPTNAME = OPR:DEPTNAME ! DISPLAY LOOKUP FIELD
SCR:OPERNAME = OPR:OPERDESC ! DISPLAY LOOKUP FIELD
.
SHOW_EMP ROUTINE !Display Lookup Fields
CALC_TIME ROUTINE !Calculate Total Time
WIP:TOTAL_TIME = 0 !Clear Variable
WIP:TOTAL_TIME = (((SAV:ENDTIME1 - SAV:BEGTIME1) + | !Accumulate Prod Times
(SAV:ENDTIME2 - SAV:BEGTIME2) + | !Accumulate Prod Times
(SAV:ENDTIME3 - SAV:BEGTIME3) + | !Accumulate Prod Times
(SAV:ENDTIME4 - SAV:BEGTIME4) + | !Accumulate Prod Times
(SAV:ENDTIME5 - SAV:BEGTIME5) + | !Accumulate Prod Times
(SAV:ENDTIME6 - SAV:BEGTIME6) + | !Accumulate Prod Times
(SAV:ENDTIME7 - SAV:BEGTIME7) + | !Accumulate Prod Times
(SAV:ENDTIME8 - SAV:BEGTIME8) + | !Accumulate Prod Times
(SAV:ENDTIME9 - SAV:BEGTIME9))/100) !Accumulate Prod Times
DISPLAY(?WIP:TOTAL_TIME) !Display Field