For all those programmers using emulators other than Client Access (and other similar advanced emulators), you...
can color your source code/inline comments using SQL. The color codes for some are as given below:
In SQL/400, create an alias of the source member you want to color in QTEMP. If I want to color source member PGM1 in QRPGSRC my SQL statement would be something like:
Query 1: CREATE ALIAS QTEMP/ALIAS# FOR LIB/QRPGSRC (PGM1)
The alias would enable us to access different members of file using SQL.
Query 2: UPDATE QTEMP/ALIAS# SET SRCDTA = SUBSTR(SRCDTA,1,4)||X'22'||SUBSTR(SRCDTA,6,94) WHERE SUBSTR(SRCDTA,7,1) = '*'
We are updating the source line by including hex color code in sixth byte of the source.
This query would change the color of all comment line to white.
Condition your query as you like based on any field SRCDTA, SRCSEQ, SRCDAT.
Query 3: DROP ALIAS QTEMP/ALIAS#
This drops the alias file created in QTEMP.
The table of valid hex values for display colors is shown below:
|21||Green, reverse image|
|23||White, reverse image|
|25||Green, underscore, reverse image|
|29||Red, reverse image|
|2A||Red, high intensity|
|2B||Red, high intensity, reverse image|
|2D||Red, underscore, reverse image|
|2E||Red, underscore, blink|
|30||Turquoise, column separator|
|31||Turquoise, column separator, reverse image|
|32||Yellow, column separator|
|33||White, reverse image, column separator|
|34||Turquoise, underscore, column separator|
|35||Turquoise, underscore, reverse image, column separator|
|36||Yellow, underscore, column separator|
|39||Pink, reverse image|
|3B||Blue, reverse image|
|3D||Pink, underscore, reverse image|
We encourage readers to submit a tip on use of the AS/400 system for potential publication. Just click on "Submit a Tip" below.