Tip

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 first published in February 2001

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
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
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.