構造化プログラミングの方法

2:(再投稿)構造化プログラミングの方法
江須扇 08/19 14:18

コーディング例


----------------------------------------------------------------------

000010 IDENTIFICATION DIVISION.
000020 PROGRAM-ID. ACPTST.
000030 ENVIRONMENT DIVISION.
000040 CONFIGURATION SECTION.
000050 SOURCE-COMPUTER. EXPRESS5800.
000060 OBJECT-COMPUTER. EXPRESS5800.
000070 DATA DIVISION.
000080 WORKING-STORAGE SECTION.
000090 77 A-CELL PIC X(05).
000100 77 B-CELL PIC X(05).
000110 01 SWITCH-FLAG PIC 9(01) VALUE 0.
000120 88 SWITCH-HTAB VALUE 1.
000130 88 SWITCH-BSKIP VALUE 9.
000140 SCREEN SECTION.
000150 SD GAMEN END STATUS IS END-STATUS.
000160 01 ACEP-A CLEAR SCREEN.
000170     02 LINE 05 COLUMN 10 PIC X(05) USING A-CELL.
000180 01 ACEP-B.
000190     02 LINE 10 COLUMN 10 PIC X(05) INTO B-CELL.
000200 01 DISP-C.
000210     02 LINE 15 COLUMN 10 PIC N(05) FROM A-CELL.
000220     02 LINE 20 COLUMN 10 PIC N(05) FROM B-CELL WAIT.
000230 PROCEDURE DIVISION.
000240 INIT-RTN.
000250     SET SWITCH-BSKIP TO TRUE.
000260     PERFORM UNTIL END-STATUS = "P9"
000270       EVALUATE TRUE
000280           WHEN SWITCH-BSKIP
000290                ACCEPT ACEP-A
000300                IF END-STATUS = "01"
000310                                     SET SWITCH-HTAB TO TRUE
000320                END-IF
000330           WHEN SWITCH-HTAB
000340                DISPLAY ACEP-A
000350                ACCEPT ACEP-B
000360                EVALUATE END-STATUS
000370                    WHEN "01" PERFORM MAIN-RTN
000380                    WHEN "09" SET SWITCH-BSKIP TO TRUE
000390                END-EVALUATE
000400       END-EVALUATE
000410     END-PERFORM.
000420     STOP RUN.
000430******************************************************************
000440 MAIN-RTN.
000450     DISPLAY DISP-C.


1-

BluesBB ©Sting_Band