In addition to what I wrote about in my tip, Using SQL on System i to color source code and inline comments, it is also possible to have multicolored lines for comments using SQL, like the one shown below:
[IMAGE]
The key to this is inserting hexadecimal codes in the byte prior to the text.
For instance, if you want to highlight some part of the text for source program PGM1 in source file QRPGSRC in library LIB1, use the following queries:
CREATE ALIAS QTEMP/ALIAS# FOR LIB1/QRPGSRC (PGM1)
Now taking the example of the above text, get the position of the text, * on the left is in position 7, M (of MODIFICATION) is in Position 11, D (of DESCRIPTION) is in position 41 and * on the right is in position 70.
If we insert hexadecimal codes into the bytes before the text, we can get multicolored lines.
Position of insertions:
For * Insert White (X'22') in position 6
For M insert Blue (X'3A') in position 10<
To continue reading for free, register below or login
To read more you must become a member of Search400.com
');
// -->

br>
For D insert Red (X'28') in position 40
For * on right insert White (X'22') in position 69
The query should be built like this:
After the query, the line will appear as below:
[IMAGE]
Although the query looks quite complex, it's simple once you understand that the first parameter in SUBST should be position of character and the second parameter should be the difference between the next position of insertion and the position of the character.
The query shown in the example is done on a source file with a length of 112 (100 bytes for SRCDTA). If your source file length is different, change your query accordingly.
Use this query only if your alias is not created in QTEMP. Otherwise it is optional.
DROP ALIAS QTEMP/ALIAS#
Please note:
We encourage readers to submit a tip on use of the AS/400 system for potential publication. Just click on "Submit a Tip" below.