ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

change DSPF field color from CL

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • change DSPF field color from CL

    Hi

    Not expert on aS400...

    I got a working CL that displays a file (DDS)

    is there easy way for me to change the color of a certain field in the DDS from the CL

    for example if field A begin with 'ERR' I would like it to be displayed in RED.



    thanks !!!!

  • #2
    Re: change DSPF field color from CL

    Sure...assign an indicator to the field:

    OUTQ 10 B 18 20
    DSPATR(MDT CS)
    43 DSPATR(PC)
    43 COLOR(RED)

    And then turn the indicator on in your CL program in the even of an error:

    CHKOBJ OBJ(&OUTQ) OBJTYPE(*OUTQ)
    MONMSG MSGID(CPF9801 CPF9810) EXEC(DO)
    RCVMSG MSGTYPE(*EXCP)
    CHGVAR VAR(&IN43) VALUE('1')
    CHGVAR VAR(&MESSAGE) VALUE('ERROR: Incorrect +
    Printer Queue name entered - try again')
    GOTO CMDLBL(LOOP)
    ENDDO

    Terry

    Comment


    • #3
      Re: change DSPF field color from CL

      Sorry but too much a bit...

      this is part of my DDS


      Code:
      Columns . . . :    1  71           Browse                          CFG/QDDSSRC 
       SEU==>                                                                  SEUMSG 
       FMT A* .....A*. 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7  
      0017.00      A***************************************************************** 
      0018.00      A          R REGU                                                  
      0019.00      A                                      OVERLAY                     
      0020.00      A                                      WINDOW(2 2 20 75)           
      0021.00      A                                      WDWBORDER((*COLOR BLU) (*DS 
      0022.00      A                                       (*CHAR '        '))        
      0023.00      A                                      WDWTITLE((*TEXT &HDR) +     
      0024.00      A                                       (*COLOR PNK) +             
      0025.00      A                                       (*DSPATR BL UL))           
      0026.00      A                                      CA21(21 'Edit')             
      0027.00      A            HDR           75   P                                  
      0028.00      A*                                 2 15'Lib:'                      
      0029.00      A*                                     COLOR(BLU)                  
      0030.00      A*           SRCLIB        10   O  2 20                            
      0031.00      A*                                 2 31'File:'                     
      0032.00      A*                                     COLOR(BLU)                  
      0033.00      A*           SRCF          10   O  2 37                            
      0034.00      A*                                 2 48'Mbr:'                      
      0035.00      A*                                     COLOR(BLU)                  
      0036.00      A*           SRCMBR        10   O  2 53                            
      0037.00      A*           OPTN           1A  B  3 10 VALUES(' ' 'R' 'Q')        
      0038.00      A*                                     DSPATR(UL)                  
      0039.00      A            LIN1          75   O  4  1                            
      0040.00      A                                      COLOR(WHT)                  
      0041.00      A            LIN2          75   O  5  1                            
      0042.00      A                                      COLOR(WHT)                  
      0043.00      A            LIN3          75   O  6  1                            
      0044.00      A                                      COLOR(WHT)                  
      0045.00      A            LIN4          75   O  7  1                            
      0046.00      A                                      COLOR(WHT)                  
      0047.00      A            LIN5          75   O  8  1                            
      0048.00      A                                      COLOR(WHT)                  
      0049.00      A            LIN6          75   O  9  1                            
      0050.00      A                                      COLOR(WHT)

      could you pls specify what needed to be added to the DDS in order to change LIN2 to RED color from CL ?

      thanks for your help and time !!!!

      Comment


      • #4
        Re: change DSPF field color from CL

        Hi gonen:

        Code:
             A            LIN1          75   O  4  1          
             A N43                                  COLOR(WHT)
             A  43                                  COLOR(RED)
             A            LIN2          75   O  5  1          
             A N43                                  COLOR(WHT)
             A  43                                  COLOR(RED)
             A            LIN3          75   O  6  1          
             A N43                                  COLOR(WHT)
             A  43                                  COLOR(RED)
             A            LIN4          75   O  7  1          
             A                                      COLOR(WHT)
             A            LIN5          75   O  8  1          
             A                                      COLOR(WHT)
             A            LIN6          75   O  9  1          
             A                                      COLOR(WHT)
        if indicator 43 is on lin1/lin2/lin3 will be red. if indicator 43 is off lin1/lin2/lin3 will be white.

        In Terry's cl this line:
        CHGVAR VAR(&IN43) VALUE('1')
        will set indicator 43 on.

        Notice I've changed the origional lin1/2/3 to use not indicator 43

        Best of Luck
        GLS
        The problem with quotes on the internet is that it is hard to verify their authenticity.....Abraham Lincoln

        Comment


        • #5
          Re: change DSPF field color from CL

          Works like a charm !!!!!!!!!!!!!!!!!!!!!

          Thank you so much !

          Comment

          Working...
          X