Imbedding screen attributes

Is there a way to highlight (or underline, or reverse-image) a portion of a field? The answer is yes -- by defining,...

and then imbedding, single-character attribute fields. I had a situation where I had a subfile of 70-character text fields. I would build each record in a temporary field and then add it to the subfile. The problem I ran into was that I wanted to reverse-image a portion of some of the subfile records, but not all of them. Obviously, I couldn't define a screen attribute to accomplish this, so I had to engineer a solution. By using the BITON and BITOFF commands, I was able to logically OR the desired screen attributes into single character fields, and then imbed those single characters anywhere I wanted that attribute to dynamically show. The character itself is invisible on the screen and takes up only one position.


* NORMAL VIDEO   - 20H - 0010 0000                            
* REVERSE IMAGE  - 21H - 0010 0001                            
* HIGH INTENSITY - 22H - 0010 0010                            
* UNDERSCORE     - 24H - 0010 0100                            
* BLINK          - 28H - 0010 1000                            
 *                                                             
 * COMBINATIONS CAN BE ACHIEVED BY LOGICALLY ORing ATTRIBUTES  
 * EXAMPLE:  FOR HIGH INTENSITY/REVERSE IMAGE, COMBINE        
 *      REVERSE IMAGE  - 21H - 0010 0001                       
 *      HIGH INTENSITY - 22H - 0010 0010                       
 *      --------------------------------                       
 *      REVERSE/HIGH   - 23H - 0010 0011                       
 * WHICH IS             BITON '  2    67'                      
 *                                                             
 *                                                             
C                   BITOFF    '01234567'    ATRRI             1
C                   BITON     '257'         ATRRI              
 *                                                             
C                   BITOFF    '01234567'    ATRHB             1
C                   BITON     '246'         ATRHB              
 *                                                             
C                   BITOFF    '01234567'    ATRHI             1
C                   BITON     '26'          ATRHI 

This was last published in February 2001

Dig Deeper on RPG iSeries programming

Start the conversation

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.

-ADS BY GOOGLE

SearchEnterpriseLinux

SearchDataCenter

Close