News
Stay informed about the latest enterprise technology news and product updates.
SEU color --code
SEU color --code
Continue Reading This Article
Enjoy this article as well as all of our content, including E-Guides, news, tips and more.
Step 2 of 2:
Here is the DSPF:
=================
A*%%TS SD 20021107 103112 PGMMGR REL-V5R1M0 5722-WDS
A*%%EC
A*%%==============================================================
A DSPSIZ(24 80 *DS3)
A CA03(03)
A CA12(12)
A R ASSUME
A ASSUME
A 2 1' '
A*%%==============================================================
A R THECOLORS
A*%%TS SD 20021107 103112 PGMMGR REL-V5R1M0 5722-WDS
A WINDOW(3 6 18 65)
A WDWBORDER((*COLOR WHT) (*DSPATR HI -
A RI) (*CHAR ' '))
A WDWTITLE((*TEXT &WINTITLE) *CENTER)
A WINTITLE 40A P
A MEMBERTYPE 10 O 1 56
A 2 1'20'
A 2 4'Green'
A 2 34'30'
A 2 37'Turqouise'
A DSPATR(CS)
A 3 1'21'
A 3 4'Green Reversed'
A DSPATR(RI)
A 3 34'31'
A 3 37'Turquoise Reversed'
A DSPATR(RI)
A DSPATR(CS)
A 4 1'22'
A 4 4'White'
A DSPATR(HI)
A 4 34'32'
A 4 37'Yellow'
A DSPATR(HI)
A DSPATR(CS)
A 5 1'23'
A 5 4'White Reversed'
A DSPATR(HI)
A DSPATR(RI)
A 5 34'33'
A 5 37'Yellow Reversed'
A DSPATR(HI)
A DSPATR(RI)
A DSPATR(CS)
A 6 1'24'
A 6 4'Green Underlined'
A DSPATR(UL)
A 6 34'34'
A 6 37'Turquoise Underlined'
A DSPATR(CS)
A DSPATR(UL)
A 7 1'25'
A 7 4'Green Underline Reversed'
A DSPATR(RI)
A DSPATR(UL)
A 7 34'35'
A 7 37'Turquoise Underlined Reversed'
A DSPATR(RI)
A DSPATR(CS)
A DSPATR(UL)
A 8 1'26'
A 8 4'White Underlined'
A DSPATR(HI)
A DSPATR(UL)
A 8 34'36'
A 8 37'Yellow Underlined'
A DSPATR(HI)
A DSPATR(CS)
A DSPATR(UL)
A 9 1'28'
A 9 4'Red'
A DSPATR(BL)
A 9 34'38'
A 9 37'Pink'
A DSPATR(CS)
A DSPATR(BL)
A 10 1'29'
A 10 4'Red Reversed'
A DSPATR(RI)
A DSPATR(BL)
A 10 34'39'
A 10 37'Pink Reversed'
A DSPATR(RI)
A DSPATR(CS)
A DSPATR(BL)
A 11 1'2A'
A 11 4'Red Blink'
A DSPATR(HI)
A DSPATR(BL)
A 11 34'3A'
A 11 37'Blue'
A DSPATR(HI)
A DSPATR(CS)
A DSPATR(BL)
A 12 1'2B'
A 12 4'Red Blink Reversed'
A DSPATR(HI)
A DSPATR(RI)
A DSPATR(BL)
A 12 34'3B'
A 12 37'Blue Reversed'
A DSPATR(HI)
A DSPATR(RI)
A DSPATR(CS)
A DSPATR(BL)
A 13 1'2C'
A 13 4'Red Underlined'
A DSPATR(BL)
A DSPATR(UL)
A 13 34'3C'
A 13 37'Pink Underlined'
A DSPATR(CS)
A DSPATR(BL)
A DSPATR(UL)
A 14 1'2D'
A 14 4'Red Underlined Reversed'
A DSPATR(RI)
A DSPATR(BL)
A DSPATR(UL)
A 14 34'3D'
A 14 37'Pink Underlined Reversed'
A DSPATR(RI)
A DSPATR(CS)
A DSPATR(BL)
A DSPATR(UL)
A 15 1'2E'
A 15 4'Red Underlined Blink'
A DSPATR(HI)
A DSPATR(BL)
A DSPATR(UL)
A 15 34'3E'
A 15 37'Blue Underlined'
A DSPATR(HI)
A DSPATR(CS)
A DSPATR(BL)
A DSPATR(UL)
A 17 1' Select: '
A DSPATR(HI)
A DSPATR(RI)
A ZCHOOSE 2A B 17 11VALUES(' ' '20' '21' '22' '23' '24-
A ' '25' '26' '28' '29' '2A' '2B' '2C-
A ' '2D' '2E' '30' '31' '32' '33' '34-
A ' '35' '36' '38' '39' '3A' '3B' '3C-
A ' '3D' '3E')
A DSPATR(PC)
A 17 14' '
A DSPATR(RI)
A DSPATR(HI)
A 17 46'F3'
A DSPATR(HI)
A 17 49'or'
A 17 52'F12'
A DSPATR(HI)
A 17 56'to return.'
and the RPGLE code:
===================
_ * ADDEXITPGM EXITPNT(QIBM_QSU_LCMD) FORMAT(EXTP0100) PGMNBR(*LOW) +
_ * PGM("QGPL"/"SEUColor")
* or
_ * WRKREGINF (Look for QIBM_QSU_LCMD, you get the idea)
+ * Hex values and their corresponding display attributes
+ * Omit 27, 2F, 37 & 3F (Nondisplay)
* __________________________________________________________
* Hex DSPATR Color
* _____ ______________ __________________________________
* x'20' __ __ __ __ __ Green
* x'21' __ __ __ __ RI |Green + Reversed
* x'22' __ __ __ HI __ +White
* x'23' __ __ __ HI RI +White + Reversed
* x'24' __ __ UL __ __ +Green + Underline
* x'25' __ __ UL __ RI
Green + Underline + Reversed
* x'26' __ __ UL HI __ _White + Underline
* x'27' -Nondisplay
* x'28' __ BL __ __ __ |Red
* x'29' __ BL __ __ RI -Red + Reversed
* x'2A' __ BL __ HI __ +Red + Blink
* x'2B' __ BL __ HI RI Red + Blink + Reversed
* x'2C' __ BL UL __ __ |Red + Underline
* x'2D' __ BL UL __ RI _Red + Underline + Reversed
* x'2E' __ BL UL HI __ _Red + Underline + Blink
* x'2F' -Nondisplay
* x'30' CS __ __ __ __ -Turqouise
* x'31' CS __ __ __ RI |Turqouise + Reversed
* x'32' CS __ __ HI __ _Yellow
* x'33' CS __ __ HI RI +Yellow + Reversed
* x'34' CS __ UL __ __ +Turqouise + Underline
* x'35' CS __ UL __ RI +Turqouise + Underline + Reversed
* x'36' CS __ UL HI __ |Yellow + Underline
* x'37' -Nondisplay
* x'38' CS BL __ __ __ |Pink
* x'39' CS BL __ __ RI -Pink + Reversed
* x'3A' CS BL __ HI __ +Blue
* x'3B' CS BL __ HI RI ?Blue + Reversed
* x'3C' CS BL UL __ __ (Pink + Underline
* x'3D' CS BL UN __ RI )Pink + Underline + Reversed
* x'3E' CS BL UL HI __ |Blue + Underline
* x'3F' -Nondisplay
* __________________
FSeuColor CF E WorkStn INFDS(TheDisplay)
* __________________
+ * Header information
DHeaderInfo DS BASED(Parm1)
D RecLength 1 4B 0
D CursorRRN 5 8B 0
-D CursorPos 9 12B 0
D CCSID 13 16B 0
D Records 17 20B 0
D MemberName 21 30
D FileName 31 40
D LibraryName 41 50
D MemberType 51 60
D CmdKey 61 61
D Mode 62 62
D SplitSess 63 63
D Res 64 64
| * Return Codes
DReturnInfo DS BASED(Parm2)
D RetCode 1 1
D Res2 2 4
D OutRecs 5 8B 0
D InsertSequence 9 15
D Res3 16 37
| * Line Command and Text
DLinInfomation DS BASED(Parm3)
D Command1 1 7
D Return1 8 20
D Text1 21 100
D Command2 101 107
D Reutrn2 108 120
D Text2 121 200
| * Entry Parameters declarations
D Parm1 S *
D Parm2 S *
D Parm3 S *
| * Display File Information Data Structure
DTheDisplay DS
D DisplayData 1 370
D Key 369 369 Key Pressed
D CurrPanel 261 270 Current Panel
D ScreenSize 67 70 Screen Size
D DeviceName 197 206 Device Name
D DeviceType 272 277 Device Type
D DeviceRows 282 283B 0 Number of Rows
D DeviceCols 284 285B 0 Number of Cols
D AllowBlink 286 286 Allow Blink
D DisplayLoc 288 288 Display Location
D RemoteLoc 294 301 Remote Location
| * Function Key Data Structure (Hexadecimal Constants for Function Keys)
DFunctionKeys DS
D F03 1A INZ(X'33') Exit Key
D F12 1A INZ(X'3C') Cancel Key
D EXIT 1A INZ(X'FF')
| * Define Program Standalone Fields
DHexPos S 2S 0 Inz(05) Hex Code Position
DMyMsg S 78 Inz(*Blanks) Error Message
DLength S 15P 5 Inz(256) QCMDEXC Length
DCommand S 256 Inz(*Blanks) Apostrophe
DApostrophe S 1A Inz('''')
+ *_____________________________________________________________________
C *Entry Plist
C Parm Parm1
C Parm Parm2
C Parm Parm3
*
* QCMDEXC Parameter List
C CommandS PList
C Parm Command
C Parm Length
*
* Bypass some sources, since the compiler reads the whole line
* and wont understand the Hex code.
C Select
C MemberType WhenEq 'CLP'
C MemberType OrEq 'CLP38'
C MemberType OrEq 'CLLE'
C MemberType OrEq 'CLMOD'
C MemberType OrEq 'MENU'
C MemberType OrEq 'CMD'
C MemberType OrEq 'HTML'
C MemberType OrEq 'TXT'
C MemberType OrEq 'PNLGRP'
C Eval MyMsg = 'Sorry, dude, you can not color a -
C source type '+ MemberType
C Eval Command = 'SNDMSG MSG(' + Apostrophe +
C MyMsg + Apostrophe +
C ') TOUSR(*REQUESTER)'
C Call 'QCMDEXC' Commands
C Exsr NoDeed
*
C Other
C Exsr DoTheDeed
C EndSl
*
C Seton LrRt
+ *_____________________________________________________________________
C DoTheDeed BEGSR
* ___________________
C Select
* F7 to change the entire line color (any line)
C When CmdKey='7' and CursorPos<>0
C Eval WinTitle = 'SEU Entire Line Color/Attribute'
* Write the Hex in pos. 5
C Eval HexPos = 5
C ExSr SetTheColor
*
* F8 to change comment line ONLY (anywhere on the line)
C When CmdKey='8' and CursorPos > 6
C If %Subst(Text1:7:1)='*'
C Eval WinTitle = 'SEU Comment Color/Attribute'
* Find if cursor is positioned on a blank. If not, find a blank
C DoW CursorPos<>0
C If %Subst(Text1:CursorPos:1)=*Blanks
C Eval HexPos = CursorPos
C ExSr SetTheColor
C Eval CursorPos = 0
C Else
C Sub 1 CursorPos
C EndIf
C EndDo
C EndIf
*
C EndSl
* F3 or F12
C Exsr NoDeed
C EndSr
*
| * Set the color
C SetTheColor BegSr
* ___________________
C Dow Key <> Exit
C ExFmt TheColors
C Select
C When Key = F03 or Key = F12
C Eval Key = Exit
C EndSl
C If ZChoose <> *Blanks
C Select
C When ZChoose = '20'
C Eval %Subst(Text1:HexPos:1)=x'20'
C When ZChoose = '21'
|C Eval %Subst(Text1:HexPos:1)=x'21'
C When ZChoose = '22'
+C Eval %Subst(Text1:HexPos:1)=x'22'
C When ZChoose = '23'
+C Eval %Subst(Text1:HexPos:1)=x'23'
C When ZChoose = '24'
+C Eval %Subst(Text1:HexPos:1)=x'24'
C When ZChoose = '25'
C Eval %Subst(Text1:HexPos:1)=x'25'
C When ZChoose = '26'
_C Eval %Subst(Text1:HexPos:1)=x'26'
C When ZChoose = '28'
|C Eval %Subst(Text1:HexPos:1)=x'28'
C When ZChoose = '29'
-C Eval %Subst(Text1:HexPos:1)=x'29'
C When ZChoose = '2A'
+C Eval %Subst(Text1:HexPos:1)=x'2A'
C When ZChoose = '2B'
|C Eval %Subst(Text1:HexPos:1)=x'2B'
C When ZChoose = '2C'
|C Eval %Subst(Text1:HexPos:1)=x'2C'
C When ZChoose = '2D'
_C Eval %Subst(Text1:HexPos:1)=x'2D'
C When ZChoose = '2E'
_C Eval %Subst(Text1:HexPos:1)=x'2E'
C When ZChoose = '30'
-C Eval %Subst(Text1:HexPos:1)=x'30'
C When ZChoose = '31'
|C Eval %Subst(Text1:HexPos:1)=x'31'
C When ZChoose = '32'
_C Eval %Subst(Text1:HexPos:1)=x'32'
C When ZChoose = '33'
+C Eval %Subst(Text1:HexPos:1)=x'33'
C When ZChoose = '34'
+C Eval %Subst(Text1:HexPos:1)=x'34'
C When ZChoose = '35'
+C Eval %Subst(Text1:HexPos:1)=x'35'
C When ZChoose = '36'
|C Eval %Subst(Text1:HexPos:1)=x'36'
C When ZChoose = '38'
|C Eval %Subst(Text1:HexPos:1)=x'38'
C When ZChoose = '39'
-C Eval %Subst(Text1:HexPos:1)=x'39'
C When ZChoose = '3A'
+C Eval %Subst(Text1:HexPos:1)=x'3A'
C When ZChoose = '3B'
?C Eval %Subst(Text1:HexPos:1)=x'3B'
C When ZChoose = '3C'
(C Eval %Subst(Text1:HexPos:1)=x'3C'
C When ZChoose = '3D'
)C Eval %Subst(Text1:HexPos:1)=x'3D'
C When ZChoose = '3E'
|C Eval %Subst(Text1:HexPos:1)=x'3E'
C EndSl
* Show that data was changed
C Exsr DeedDone
C EndIf
C EndDo
C EndSr
| * Return codes set to update
C DeedDone BegSr
* ___________________
C Eval OutRecs=1
C Eval Retcode='0'
C Eval Key = Exit
C EndSr
| * F3 or F12
C NoDeed BegSr
* ___________________
C Eval OutRecs=1
C Eval Retcode='0'
C EndSr
*________________________________________________________________