星期二, 10月 31, 2023

2000-12-26 如何將 CL SOURCE COMMENT 說明行加上顏色以加強說明重要性?



2000-12-26 如何將 CL SOURCE COMMENT 說明行加上顏色以加強說明重要性?

QCLSRC COLCLCMTC CLP

/*===================================================================*/
/* To compile:                                                       */
/*                                                                   */
/*           CRTCLPGM   PGM(XXX/COLCLCMTC) SRCFILE(XXX/QCLSRC) +     */
/*                        TEXT('COLOR CL COMMENT LINE')              */
/*                                                                   */
/*===================================================================*/
PGM

DCL        VAR(&COL) TYPE(*CHAR) LEN(1) VALUE(X'28') /* +
             Make color blue */

/*         Normal    Reverse   Underline   */

/* BLU      3A        3B        3E         */

/* GRN      20        21        24         */

/* PNK      38        39        3C         */

/* RED      28        29        2C         */

/* TRQ      34        35        34         */

/* WHT      22        23        26         */

/* YLW      32        33        36         */

DCL        VAR(&START) TYPE(*CHAR) LEN(2) VALUE('/*') +

             /* Starting characters */

DCL        VAR(&SPACE) TYPE(*CHAR) LEN(50) VALUE('This +
                          is comment color line') /* Blanks */

DCL        VAR(&END) TYPE(*CHAR) LEN(2) VALUE('*/') /* +
             Ending characters */

DCL        VAR(&COMMENT) TYPE(*CHAR) LEN(55) /* Comment +
             line */

CHKOBJ     OBJ(CHANCY/QCLSRC) OBJTYPE(*FILE) MBR(COMMENT)
MONMSG     MSGID(CPF9815) EXEC(DO)
ADDPFM     FILE(CHANCY/QCLSRC) MBR(COMMENT) +
             TEXT('Comment line for CLP') SRCTYPE(CLP)
ENDDO

CHGVAR     VAR(&COMMENT) VALUE(&START *CAT &COL *CAT +
             &SPACE *CAT &END)

OVRDBF     FILE(QCLSRC) TOFILE(CHANCY/QCLSRC) MBR(COMMENT)

CALL       PGM(COLCLCMTR) PARM(&COMMENT)

CHGVAR     %SST(&COMMENT 3 1)  X'3A'
CALL       PGM(COLCLCMTR) PARM(&COMMENT)
CHGVAR     %SST(&COMMENT 3 1)  X'20'
CALL       PGM(COLCLCMTR) PARM(&COMMENT)
CHGVAR     %SST(&COMMENT 3 1)  X'38'
CALL       PGM(COLCLCMTR) PARM(&COMMENT)
CHGVAR     %SST(&COMMENT 3 1)  X'28'
CALL       PGM(COLCLCMTR) PARM(&COMMENT)
CHGVAR     %SST(&COMMENT 3 1)  X'34'
CALL       PGM(COLCLCMTR) PARM(&COMMENT)
CHGVAR     %SST(&COMMENT 3 1)  X'22'
CALL       PGM(COLCLCMTR) PARM(&COMMENT)
CHGVAR     %SST(&COMMENT 3 1)  X'32'
CALL       PGM(COLCLCMTR) PARM(&COMMENT)

CHGVAR     %SST(&COMMENT 3 1)  X'3B'
CALL       PGM(COLCLCMTR) PARM(&COMMENT)
CHGVAR     %SST(&COMMENT 3 1)  X'21'
CALL       PGM(COLCLCMTR) PARM(&COMMENT)
CHGVAR     %SST(&COMMENT 3 1)  X'39'
CALL       PGM(COLCLCMTR) PARM(&COMMENT)
CHGVAR     %SST(&COMMENT 3 1)  X'29'
CALL       PGM(COLCLCMTR) PARM(&COMMENT)
CHGVAR     %SST(&COMMENT 3 1)  X'35'
CALL       PGM(COLCLCMTR) PARM(&COMMENT)
CHGVAR     %SST(&COMMENT 3 1)  X'23'
CALL       PGM(COLCLCMTR) PARM(&COMMENT)
CHGVAR     %SST(&COMMENT 3 1)  X'33'
CALL       PGM(COLCLCMTR) PARM(&COMMENT)

CHGVAR     %SST(&COMMENT 3 1)  X'3E'
CALL       PGM(COLCLCMTR) PARM(&COMMENT)
CHGVAR     %SST(&COMMENT 3 1)  X'24'
CALL       PGM(COLCLCMTR) PARM(&COMMENT)
CHGVAR     %SST(&COMMENT 3 1)  X'3C'
CALL       PGM(COLCLCMTR) PARM(&COMMENT)
CHGVAR     %SST(&COMMENT 3 1)  X'2C'
CALL       PGM(COLCLCMTR) PARM(&COMMENT)
CHGVAR     %SST(&COMMENT 3 1)  X'34'
CALL       PGM(COLCLCMTR) PARM(&COMMENT)
CHGVAR     %SST(&COMMENT 3 1)  X'24'
CALL       PGM(COLCLCMTR) PARM(&COMMENT)
CHGVAR     %SST(&COMMENT 3 1)  X'36'
CALL       PGM(COLCLCMTR) PARM(&COMMENT)

DLTOVR     FILE(QCLSRC)

ENDPGM

=====================================================================

QRPGSRC COLCLCMTR RPG

      *==============================================================*
      * To compile:                                                  *
      *                                                              *
      *      CRTRPGPGM  PGM(XXX/COLCLCMTR) SRCFILE(XXX/QRPGSRC) +    *
      *                   TEXT('COLOR CL COMMENT LINE')              *
      *                                                              *
      *==============================================================*
     FQCLSRC  O   E                    DISK
     F            QCLSRC                            KRENAMEMAINRC
      ******************************************************
     C           *ENTRY    PLIST
     C                     PARM           COMM   55
     C                     Z-ADD1         SRCSEQ
     C                     MOVE *ZEROS    SRCDAT
     C                     MOVELCOMM      SRCDTA    P
     C                     WRITEMAINRC
     C                     MOVE *ON       *INLR


沒有留言: