home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Media Share 9
/
MEDIASHARE_09.ISO
/
clarion
/
multiadd.zip
/
MULTIADD.COM
/
ROUTE11.CLA
next >
Wrap
Text File
|
1989-06-30
|
11KB
|
277 lines
MEMBER('ROUTE')
WIP_TABLE PROCEDURE
SCREEN SCREEN WINDOW(18,25),AT(4,3),PRE(SCR),HUE(15,1)
OMIT('**-END-**')
╔═══════════════════════╗
║ Labor Ticket File ║
║ ║
║ Goto Lot# :■■■■■■ ║
║ ║
║ LotNbr Part# Dept Opr ║
║ ------ ----- ---- --- ║
║ ■■■■■■ ■■■■■ ## ### ║
║ ║
║ ║
║ ║
║ ║
║ ║
║ ║
║ ║
║ ║
║ ║
╚═══════════════════════╝
**-END-**
ROW(1,1) STRING('<201,205{23},187>')
ROW(2,1) REPEAT(16);STRING('<186,0{23},186>') .
ROW(18,1) STRING('<200,205{23},188>')
ROW(2,5) STRING('Labor Ticket File')
ROW(6,3) STRING('LotNbr Part# Dept Opr')
ROW(7,3) STRING('-{6} -{5} ---- ---')
COL(24) ENTRY,USE(?FIRST_FIELD)
ROW(4,5) STRING('Goto Lot# :')
COL(16) ENTRY(@S6),USE(WIP:LOTNBR),HUE(14,1),SEL(10,1),NUM |
LFT,UPR
REPEAT(10),INDEX(NDX)
ROW(8,2) POINT(1,23),USE(?POINT),ESC(?-1)
LOTNBR COL(3) STRING(6)
PARTNBR COL(10) STRING(5)
DEPTNBR COL(17) STRING(@N02)
OPERNBR COL(21) STRING(@N03)
. .
TABLE TABLE !TABLE OF RECORD POINTERS
TBLPTR LONG ! POINTER TO DATA RECORD
.
NDX BYTE !REPEAT INDEX FOR POINT FIELD
ROW BYTE !ACTUAL ROW OF SCROLL AREA
COL BYTE !ACTUAL COLUMN OF SCROLL AREA
MAX LONG !LESSER OF COUNT AND RECORDS
COUNT BYTE(10) !NUMBER OF ITEMS TO SCROLL
ROWS BYTE(10) !NUMBER OF ROWS TO SCROLL
COLS BYTE(23) !NUMBER OF COLUMNS TO SCROLL
EJECT
CODE
ACTION# = ACTION !SAVE ACTION
OPEN(SCREEN) !OPEN THE SCREEN
SETCURSOR !TURN OFF ANY CURSOR
NDX = 1 !PUT SELECTOR BAR ON TOP ITEM
ROW = ROW(?POINT) !REMEMBER TOP ROW AND
COL = COL(?POINT) ! LEFT COLUMN OF SCROLL AREA
IF ACTION = 4 !IF THIS IS A LOOKUP REQUEST
SET(WIP:LOT_KEY,WIP:LOT_KEY) ! FIND IT IN THE FILE
NEXT(WIP) ! AND READ IT
POINTER# = POINTER(WIP) ! SAVE POINTER TO CURRENT
SKIP(WIP,-1) ! MAKE IT THE TOP RECORD
DO SHOW_TABLE ! FILL SCROLL AREA
GET(WIP,POINTER#) ! AND REFRESH CURRENT RECORD
ELSE !OTHERWISE
SET(WIP:LOT_KEY) ! SET TO FIRST RECORD IN FILE
DO SHOW_TABLE ! FILL SCROLL AREA
.
RECORDS# = TRUE !INITIALIZE RECORDS FLAG
LOOP !LOOP UNTIL USER EXITS
MAX = RECORDS(WIP:LOT_KEY) !SET LESSER OF FILE RECORD
IF MAX > COUNT THEN MAX = COUNT. ! COUNT AND SCROLL ITEM COUNT
ACTION = ACTION# !RESTORE ACTION
POINTER# = 0 !CLEAR ADD POINTER
IF ~RECORDS(WIP:LOT_KEY) !IF THERE ARE NO RECORDS
CLEAR(WIP:RECORD) ! CLEAR RECORD AREA
ACTION = 1 ! SET ACTION TO ADD
WIP_FORM ! CALL FORM FOR FIRST RECORD
IF ~RECORDS(WIP:LOT_KEY) THEN BREAK. ! IF ADD ABORTED THEN EXIT
SET(WIP:LOT_KEY) ! SET TO NEW RECORD
DO SHOW_TABLE ! FILL SCROLL AREA
NDX = 1 ! PUT SELECTOR BAR ON TOP ITEM
MAX = 1 ! MAXIMUM DISPLAYED IS 1
. !
ALERT !RESET ALERTED KEYS
ALERT(REJECT_KEY) !ALERT SCREEN REJECT KEY
ALERT(ACCEPT_KEY) !ALERT SCREEN ACCEPT KEY
ACCEPT !READ A FIELD
IF KEYCODE() = REJECT_KEY THEN BREAK. !RETURN ON SCREEN REJECT KEY
EDIT_RANGE# = FIELD() !SET ONE FIELD EDIT RANGE
IF KEYCODE() = ACCEPT_KEY AND | !ON SCREEN ACCEPT KEY
EDIT_RANGE# <> ?POINT ! AND NOT ON THE POINT FIELD
UPDATE ! MOVE ALL FIELDS FROM SCREEN
EDIT_RANGE# = ?POINT - 1 ! AND EDIT REMAINING FIELDS
SELECT(?POINT) ! IF OK THEN START HERE NEXT
. !
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 OR | ! RETURN ON ESC KEY
RECORDS# = FALSE ! OR NO RECORDS
FREE(TABLE) ! FREE THE MEMORY TABLE
RETURN
.
OF ?WIP:LOTNBR !Production Lot Number
DO FIND_RECORD
RECORDS# = TRUE ! ASSUME RECORDS ARE HERE
OF ?POINT !FROM THE POINT FIELD
CASE KEYCODE() ! PROCESS THE KEYSTROKE
OF INS_KEY !*INSERT KEY
ACTION = 1 !* SET ACTION TO ADD
LOOP UNTIL ACTION <> 1 !* DO UNTIL ADD IS ABORTED
CLEAR(WIP:RECORD) !* CLEAR RECORD AREA
WIP_FORM !* CALL FORM FOR NEW RECORD
POINTER# = POINTER(WIP) !* REMEMBER WHICH RECORD
SET(WIP:LOT_KEY,WIP:LOT_KEY) !* SET TO NEW RECORD AND
SKIP(WIP,-1) !* MAKE IT THE TOP ITEM
DO SHOW_TABLE !* DISPLAY THAT PAGE
.
OF ENTER_KEY !ENTER KEY OR
OROF ACCEPT_KEY !CTRL ENTER KEY
DO GET_RECORD ! READ THE SELECTED RECORD
IF ERROR() ! IF RECORD HAS BEEN DELETED
MEM:MESSAGE = ERROR() ! TELL USER WHAT HAPPENED
GBL:DISK_ERROR = FILE_ERR() !* DISPLAY FILE ERROR
SELECT(?) ! STAY IN THE POINT FIELD
DO SHOW_TABLE ! SHOW IT
BREAK ! AND GET ANOTHER KEY
.
IF ACTION = 4 AND KEYCODE() = ENTER_KEY! IF THIS IS A LOOKUP REQUEST
ACTION = 0 ! SET ACTION TO COMPLETE
FREE(TABLE) ! FREE THE MEMORY TABLE
RETURN ! AND RETURN TO CALLER
. !
ACTION = 2 ! SET ACTION TO CHANGE
WIP_FORM ! CALL FORM TO CHANGE RECORD
IF ~ACTION ! IF THE RECORD WAS CHANGED
POINTER# = POINTER(WIP) ! REMEMBER WHICH RECORD
SET(WIP:LOT_KEY,WIP:LOT_KEY) ! SET TO CHANGED RECORD
SKIP(WIP,-1) ! MAKE IT THE TOP ITEM
DO SHOW_TABLE ! AND DISPLAY THAT PAGE
.
OF DEL_KEY !DELETE KEY
DO GET_RECORD ! READ THE SELECTED RECORD
IF ERROR() ! IF RECORD HAS BEEN DELETED
MEM:MESSAGE = ERROR() ! TELL USER WHAT HAPPENED
GBL:DISK_ERROR = FILE_ERR() !* DISPLAY FILE ERROR
SELECT(?) ! STAY IN THE POINT FIELD
DO SHOW_TABLE ! SHOW IT
BREAK ! AND GET ANOTHER KEY
.
ACTION = 3 ! SET ACTION TO DELETE
WIP_FORM ! CALL FORM TO DELETE RECORD
IF ~ACTION ! IF RECORD WAS DELETED
SKIP(WIP,-COUNT) ! SET NEXT RECORD ON TOP
DO SHOW_TABLE ! AND DISPLAY THAT PAGE
.
OF DOWN_KEY !DOWN ARROW KEY
IF NOT EOF(WIP) ! IF THERE ARE MORE RECORDS
SCROLL(ROW,COL,ROWS,COLS,ROWS(?POINT)) ! SCROLL THE SCREEN UP
NEXT(WIP) ! READ THE BOTTOM RECORD
GET(TABLE,1) ! GET THE TOP POINTER
DELETE(TABLE) ! REMOVE TOP ITEM
TBLPTR = POINTER(WIP) ! DETERMINE RECORD POINTER
ADD(TABLE) ! ADD TO BOTTOM OF TABLE
DO SHOW_RECORD ! AND DISPLAY IT
.
OF PGDN_KEY !PAGE DOWN KEY
IF EOF(WIP) ! ON THE LAST PAGE
NDX = MAX ! POINT TO BOTTOM ITEM
ELSE ! OTHERWISE
DO SHOW_TABLE ! DISPLAY NEXT PAGE
.
OF CTRL_PGDN !CTRL-PAGE DOWN KEY
NDX = MAX ! POINT TO BOTTOM ITEM
IF NOT EOF(WIP) ! ON THE LAST PAGE
SET(WIP:LOT_KEY) ! SET TO BOTTOM RECORD MINUS
SKIP(WIP,-COUNT) ! ONE PAGE OF RECORDS
DO SHOW_TABLE ! DISPLAY THE LAST PAGE
.
OF UP_KEY !UP ARROW KEY
SKIP(WIP,-(COUNT-1)) ! SET TO TOP RECORD MINUS ONE
IF NOT BOF(WIP) ! IF THERE IS A PRIOR RECORD
PREVIOUS(WIP) ! READ THE TOP RECORD
IF NOT ERROR() ! IF RETRIEVED OKAY
SCROLL(ROW,COL,ROWS,COLS,-(ROWS(?POINT)))! SCROLL THE SCREEN DOWN
GET(TABLE,RECORDS(TABLE)) ! GET THE LAST POINTER
DELETE(TABLE) ! REMOVE LAST ITEM
TBLPTR = POINTER(WIP) ! DETERMINE RECORD POINTER
ADD(TABLE,1) ! ADD TO TOP OF TABLE
DO SHOW_RECORD ! AND DISPLAY IT
ELSIF ERRORCODE() = 33 ! ELSE IF RECORD NOT AVAIL
NEXT(WIP) ! RETURN TO FIRST RECORD
. .
SKIP(WIP,COUNT-1) ! SET RECORD FOR NEXT PAGE
OF PGUP_KEY !PAGE UP KEY
SKIP(WIP,-(COUNT-1)) ! SET TO TOP RECORD MINUS ONE
IF BOF(WIP) ! IF THERE IS NO PRIOR RECORD
NDX = 1 ! THEN POINT TO TOP ITEM
SKIP(WIP,COUNT-1) ! SET RECORD FOR THIS PAGE
ELSE ! OTHERWISE
SKIP(WIP,-(COUNT+1)) ! SET RECORD FOR PRIOR PAGE
DO SHOW_TABLE ! AND DISPLAY THE PAGE
.
OF CTRL_PGUP !CTRL-PAGE UP KEY
SET(WIP:LOT_KEY) ! SET TO FIRST RECORD
NDX = 1 ! POINT TO TOP ITEM
DO SHOW_TABLE ! AND DISPLAY THE PAGE
.
. . .
FREE(TABLE) !FREE THE MEMORY TABLE
RETURN !RETURN TO CALLER
SHOW_TABLE ROUTINE !DISPLAY A PAGE OF RECORDS
FREE(TABLE) ! FREE THE MEMORY TABLE
SKIP(WIP,COUNT-1) ! SET TO THE BOTTOM RECORD
IF EOF(WIP) ! FOR A PARTIAL PAGE
SET(WIP:LOT_KEY) ! SET TO THE LAST RECORD
SKIP(WIP,-COUNT) ! AND BACK UP ONE PAGE
ELSE ! OTHERWISE
SKIP(WIP,-(COUNT-1)) ! SET RECORD FOR THIS PAGE
.
NDX# = NDX ! SAVE REPEAT INDEX
LOOP NDX = 1 TO COUNT ! LOOP THRU THE SCROLL AREA
IF EOF(WIP) THEN BREAK. ! BREAK ON END OF FILE
NEXT(WIP) ! READ THE NEXT RECORD
TBLPTR = POINTER(WIP) ! GET THE RECORD NUMBER
ADD(TABLE) ! ADD IT TO THE TABLE
DO SHOW_RECORD ! AND DISPLAY IT
IF POINTER(WIP) = POINTER# THEN NDX# = NDX.!POINT TO CORRECT RECORD
.
NDX = NDX# ! RESTORE REPEAT INDEX
CLEAR(WIP:RECORD) ! CLEAR RECORD AREA
IF RECORDS(WIP:LOT_KEY) < COUNT ! IF RECORDS DO NOT FILL
NDX#= RECORDS(WIP:LOT_KEY) * 1 ! GET NUMBER TIMES SIZE
BLANK(ROW + NDX#,COL,ROWS-NDX#,COLS) ! BLANK REMAINING AREA
.
SHOW_RECORD ROUTINE !DISPLAY A RECORD
SCR:LOTNBR = WIP:LOTNBR
SCR:PARTNBR = WIP:PARTNBR
SCR:DEPTNBR = WIP:DEPTNBR
SCR:OPERNBR = WIP:OPERNBR
GET_RECORD ROUTINE !READ SELECTED RECORD
GET(TABLE,NDX) ! GET THE TABLE RECORD
GET(WIP,TBLPTR) ! GET THIS RECORD
FIND_RECORD ROUTINE !LOCATE REQUESTED RECORD
SET(WIP:LOT_KEY,WIP:LOT_KEY) ! SET TO REQUESTED RECORD
IF EOF(WIP) ! IF BEYOND END OF FILE
PREVIOUS(WIP) ! GET THE LAST RECORD
ELSE ! ELSE
NEXT(WIP) ! READ THIS RECORD
.
POINTER# = POINTER(WIP) ! SAVE ITS RECORD POINTER
SKIP(WIP,-1) ! MAKE IT THE TOP RECORD
DO SHOW_TABLE ! AND FILL THE SCROLL AREA
SAME_PAGE ROUTINE !SET TO SAME PAGE ROUTINE
POINTER# = POINTER(WIP) ! SAVE ITS RECORD POINTER
GET(WIP,POINTER#) ! GET THE CURRENT RECORD
SET(WIP:LOT_KEY,WIP:LOT_KEY) ! SET TO NEW RECORD AND