IF (CHG-FUNCTION) GO TO AAM755-GOODCHG ELSE GO TO AAM756-CONT. AAM755-GOODCHG. MOVE REDKY TO TWA-DB-CMD. MOVE TWA-DB-REQUEST TO TWA-DB-REQ-SAV. * * * DEFAULT ALGORITHM %GOODCHG STARTS HERE MOVE UPDATED-MSG TO SCOMPL. MOVE SEE-LIT TO T-FUNCT. MOVE TEST-FUNCT TO SFUNCT. MOVE GA-LIT TO TWA-DB-RETURN-CODE. MOVE QUOTE TO TWA-MSK-AID. MOVE FOUR TO TWA-MSK-CUR-AD-IN. GO TO AA100-CHECK-FUNCTION. * * * DEFAULT ALGORITHM %GOODCHG ENDS HERE AAM756-CONT. IF (DEL-FUNCTION) GO TO AAM757-GOODDEL ELSE GO TO AAM758-CONT. AAM757-GOODDEL. * * * DEFAULT ALGORITHM %GOODDEL STARTS HERE MOVE DELETED-MSG TO SCOMPL. GO TO AA800-SEND-SCREEN. * * * DEFAULT ALGORITHM %GOODDEL ENDS HERE AAM758-CONT. GO TO AA800-SEND-SCREEN. ****************************************************** * * * END OF MAINT FUNCTIONS MAINLINE LOGIC * * * ****************************************************** ``` The AAM750 routines check the return code from MAGECIO and handle all possible conditions. Notice the insertion points (cont.) %UPDERR, %GOODADD, %GOODCHG, and %GOODDEL provided for you. The Default logic is shown, it usually just moves a message (cont.) into SCOMPL and exits to send the screen. For an ADD Function, on successful completion, it alters the Function Code to (cont.) the SEE Function so the the Operator cdfoan press ENTER to display the record just added and then use the NXT Function (cont.) if desired. You might find many reasons to want to add Customization logic into any of these insertion points. One common use is to FTH-FUNCT to another Function after a successful ADD, etc. ## Short List Routine ``` AAP100-POP-UP-SHORT-LIST. IF (TWA-MSK-PF13-HIT) MOVE PRINTS-FUNCT TO SFUNCT MOVE FTH-FUNCT TO TWA-NONTP-REQUEST GO TO AA900-GOBACK. IF (TWA-MSK-PF5-HIT) OR (TWA-MSK-PF7-HIT) MOVE F TO TWA-BROWSE-DIRECTION MOVE N TO MMP-NEW-TRANSACTION. MOVE TEN TO NUMBER-OF-RECORDS. MOVE TWA-SHORT-LIST-SOURCE TO WS-SL-SOURCE. IF (NOT TWA-COLOR-CRT) MOVE DEFAULT-COLOR TO WINDOW-COLOR MOVE ATSADHNM TO MSK6PU-SLINEA (1) MSK6PU-SLINEA (2) MSK6PU-SLINEA (3) MSK6PU-SLINEA (4) MSK6PU-SLINEA (5) MSK6PU-SLINEA (6) MSK6PU-SLINEA (7) MSK6PU-SLINEA (8) MSK6PU-SLINEA (9) MSK6PU-SLINEA (10) ELSE MOVE REVERSE-VIDEO TO MSK6PU-SLINEH (1) MSK6PU-SLINEH (2) MSK6PU-SLINEH (3) MSK6PU-SLINEH (4) MSK6PU-SLINEH (5) MSK6PU-SLINEH (6) MSK6PU-SLINEH (7) MSK6PU-SLINEH (8) MSK6PU-SLINEH (9) MSK6PU-SLINEH (10). MOVE WINDOW-COLOR TO MSK6PU-SLINE-COLOR (1) MSK6PU-SLINE-COLOR (2) MSK6PU-SLINE-COLOR (3) MSK6PU-SLINE-COLOR (4) MSK6PU-SLINE-COLOR (5) MSK6PU-SLINE-COLOR (6) MSK6PU-SLINE-COLOR (7) MSK6PU-SLINE-COLOR (8) MSK6PU-SLINE-COLOR (9) MSK6PU-SLINE-COLOR (10). MOVE WS-SHORT-LIST-HDG TO MSK6PU-SLINE (1). MOVE SPACES TO MSK6PU-SLINE (3) MSK6PU-SLINE (4) MSK6PU-SLINE (5) MSK6PU-SLINE (6) MSK6PU-SLINE (7) MSK6PU-SLINE (8) MSK6PU-SLINE (9) MSK6PU-SLINE (10). MOVE THIRTY-NINE TO WINDOW-WIDTH. MOVE SKEY TO NORM-KEY. IF (NEW-TRANSACTION-MODE) OR (TWA-NR-LINES-SENT < NINE) MOVE ONE TO D-SUB * MOVE ' (items 01 - 08) ' TO MSK6PU-SLINE (2) ELSE * MOVE ' (items 09 - 16) ' TO MSK6PU-SLINE (2) MOVE NINE TO D-SUB. MOVE WS-SHORT-LIST-SCOMPL TO MSK6PU-SCOMPL. MOVE D-SUB TO TWA-FIRST-POP-LINE. MOVE TWO TO TWA-MSK-CUR-AD-OT. MOVE TWO TO LIN-CTR. AAP749-MOVE. MOVE TWA-SV-M-KEY (D-SUB) TO TEST-KEY. PERFORM CA500-MOVE-SKEY THRU CA599-EXIT. ADD ONE TO LIN-CTR. MOVE SPACE TO NORMALIZED-KEY. MOVE SKEY TO NK-2-END. MOVE NORMALIZED-KEY TO MSK6PU-SLINE (LIN-CTR). IF D-SUB = TWA-SV-M-SUB MOVE NO-HILITE TO MSK6PU-SLINEH (LIN-CTR) MOVE LIN-CTR TO TWA-MSK-CUR-AD-OT. IF LIN-CTR LESS THAN TEN AND D-SUB LESS THAN TWA-NR-LINES-SENT THEN ADD ONE TO D-SUB GO TO AAP749-MOVE. AAP750-LEAVE-POP-SND-SCRN. MOVE NORM-KEY TO SKEY. * * * NEXT, TRUNCATE LINES TO DESIRED WINDOW WIDTH * * * AND SET STOPPER ADDRESSES ACCORDINGLY MOVE MSK6PU-SCREEN-CONSTANTS TO SCREEN-CONSTANT-WORK. MOVE TWA-MSK-EDIT-WORDS TO SCREEN-EDIT-WORK. MOVE ZEERO TO SCW-SUB. AAP752-NEXT-STOPPER. ADD ONE TO SCW-SUB. IF SCW-SUB > TEN GO TO AAP755-CONT. COMPUTE MSK6PU-SLINE-POSN (SCW-SUB) = TOP-LEFT-POSN + (SCW-SUB * EIGHTY) - EIGHTY. MOVE MSK6PU-SLINE-POSN (SCW-SUB) TO SEW-POSN (SCW-SUB). COMPUTE SCW-POSN (SCW-SUB) = MSK6PU-SLINE-POSN (SCW-SUB) + WINDOW-WIDTH + ONE. MOVE MSK6PU-SLINE (SCW-SUB) TO SLINE-WORK. MOVE WINDOW-WIDTH TO SLW-SUB. MOVE VERTICAL-BAR TO SLW-BYTE (SLW-SUB). ADD ONE TO SLW-SUB. AAP753-TRUNCATE. MOVE VERTICAL-BAR TO SLW-BYTE (1). MOVE LOW-VALUE TO SLW-BYTE (SLW-SUB). IF SLW-SUB LESS THAN SEVENTY-EIGHT ADD ONE TO SLW-SUB GO TO AAP753-TRUNCATE. MOVE SLINE-WORK TO MSK6PU-SLINE (SCW-SUB). GO TO AAP752-NEXT-STOPPER. AAP755-CONT. MOVE SCREEN-CONSTANT-WORK TO MSK6PU-SCREEN-CONSTANTS. MOVE LOW-VALUES TO END-SEW. MOVE SCREEN-EDIT-WORK TO TWA-MSK-EDIT-WORDS. COMPUTE TWA-MSK-CUR-AD-IN = MSK6PU-SLINE-POSN (TWA-MSK-CUR-AD-OT). MOVE TWA-MSK-CUR-AD-IN TO TWA-MSK-CUR-AD-OT. MOVE MSK6PU-SFUNCT TO TWA-LAST-FUNCT. MOVE MSK6PU-SKEY TO TWA-LAST-KEY. GO TO AA800-SEND-SCREEN. AA760-ATTACH. MOVE TWA-MSK-CUR-AD-IN TO TWA-MSK-CUR-AD-OT. MOVE SCOMPL TO VS-ATT-SCOMPL-SV. MOVE SERRMSG TO VS-ATT-SERRMSG-SV. MOVE HIGH-VALUE TO TWA-MSK-AID. MOVE ATT-FUNCT TO TWA-NONTP-REQUEST. GO TO AA900-GOBACK. AA770-DETACH. MOVE LOW-VALUE TO TWA-MSK-AID. MOVE DET-FUNCT TO TWA-NONTP-REQUEST. GO TO AA900-GOBACK. AA780-ESCAPE-TO-MENU. MOVE QUOTE TO TWA-MSK-AID. MOVE TWA-LAP TO WS-EPF3-LAP MOVE SFUNCT TO WS-EPF3-PREFIX. MOVE WS-ESC-PF3-SKEY TO SKEY. MOVE WS-ESC-PF3-SFUNCT TO SFUNCT. MOVE FTH-FUNCT TO TWA-NONTP-REQUEST. GO TO AA900-GOBACK. ``` The above logic produces the Short List pop-up window. The Short List is a list of record ID's which is saved when the (cont.) operator does a LOC, SCN, or FND function. The Short List contains the ID's of the items which were displayed on the (cont.) screen. In the case of a SCN or FND function that means that the Short List is a list of those items which matched the (cont.) search criteria. The logic in the AAP100 routine is invoked when the operator presses PF24 while in a MAINT function. That means that (cont.) he/she could have done a query and then cursor-selected an item and been transferred to the maintenance screen for that (cont.) item. Then he/she can press PF24 and a pop-up window will display the Short List. He/She can cursor-select from the (cont.) Short List pop-up display and be transferred to the maintenance display for the selected item, and so (cont.) forth. If you desired to add your own pop-up displays to a program you might study this routine and model yours after it. All (cont.) pop-up displays can use the same screen mask (MSK6PU). You can set the position and width of the pop-up window and you (cont.) can set the color of it. You can control the color, position, and width of the pop-up window using the data fields: WINDOW-COLOR, TOP-LEFT-POSN, and WINDOW-WIDTH. The AA760-ATTACH routine is branched to by the program logic when the program is to Attach down to the next level, as in going from a LOC function to a MAINT function. The AA770-DETACH routine is branched to by the program logic when the program is to Detach back up to the next level, such as going from a MAINT function back to a LOC function. The AA780 routine is used to exit back to the low-level menu from this application. It is normally branched to when the Operator presses the PF3 key. ## Exit Routines ``` AA800-SEND-SCREEN. IF TWA-MSK-ID = COMMON-POP-MSK Next: https://magec.com/DOC/markdown/genmmp16.md.txt