Previous Topic: AGR-MODE Field ExamplesNext Topic: Using the AGR-MODE field (example 2)


Using the AGR-MODE-field (example 1)

IF ANY OF (EMPLOYEE-NBR, SKILL-CODE, SKILL-LEVEL)
  ARE CHANGED
   DO.
     MOVE 'Y' TO FIRST-PASS-FLAG.
     MOVE EMPLOYEE-NBR TO WK-EMPNBR.
     MOVE SKILL-CODE TO WK-SKLCODE.
     MOVE SKILL-LEVEL TO WK-SKLEVEL.
     LINK TO 'CEMDUEMP'.
   END.
IF AGR-STEP-MODE
   DO.
     IF FIRST-PASS-FLAG='Y'
       DO.
         MOVE 'N' TO FIRST-PASS-FLAG.
         DISPLAY MSG TEXT IS 'EMPLOYEE UPDATED'.
       END.
     MOVE 'Y' TO FIRST-PASS-FLAG.
   END.
EXECUTE NEXT FUNCTION.

The preceding sample process code illustrates the manner in which a dialog can query the AGR-MODE field of the .hw ADSO--APPLICATION--GLOBAL--RECORD to determine what course to follow. If the dialog is in STEP mode, the dialog redisplays the screen with a confirmation message for the user; if in FAST mode, control is passed immediately to the next function. The initial value of AGR-MODE is supplied by the runtime system; the user can alter the value of AGR-MODE at any time during application execution.