* Program Name: COLORRPG
* Description: Colorize a Source Member (RPG/400 members)
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* Color Code Hex Color
* ---------- --- ------------------------------------
* ` 20 Green
* ~ 22 White
* ! 28 Red
* @ 38 Pink
* ¢ 3A Blue
*
* Source Physical file:
* 1 - 6 Sequence Number
* 7 - 12 Date of last Change
* 13 - 92 80 Bytes of data (normally)
* | RPG source
* ---- 13 - 17 - Pgm seq number
* 18 - 18 - specification code (H,F,E,T,I,C,O)
* 19 - 19 - comment if '*'
* ---------------------------------------------------------------
FSOURCE UF F 256 DISK
E SRC 73 1
ISOURCE AA 01
I 19 19 ASK
I 20 92 SRCE
I '`~!@¢' C CODE
I X'202228383A' C ATTR
I X'20' C GRN
*
C MOVE *BLANKS BLANK6 6 dfn blnk fld
* Read a record
C READ SOURCE 51 read rec
* Start Main Do while loop
C *IN51 DOWEQ*OFF Dow *in51 off
C ADD 1 RECS incr rec cntr
C MOVE *OFF COLOR 1 reset color flag
* Only colorize commented lines
C ASK IFEQ '*' If comment
C CODE:1 SCAN SRCE:1 Y 61 find color code
C *IN61 IFEQ *ON If found
C MOVE *ON COLOR set color flag
C ENDIF Endif(found)
* xlate special characters to hex
C CODE:ATTR XLATESRCE SRC1 73
C MOVEASRC1 SRC
* check if color was turned on
* If yes, then reset color to green
C COLOR IFEQ *ON If color on
C MOVE GRN SRC,73 set color green
C ENDIF Endif(color on)
* update record
C EXCPTUPDATE Update recd
C ENDIF Endif(comment)
C READ SOURCE 51 read record
C ENDDO Enddo(*in51)
* End of program
C MOVE *ON *INLR End pgm
C RETRN Return
OSOURCE E UPDATE
O BLANK6 12
O SRC 92