ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Colors not conditioned w/ indicators changing on their own

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

  • Colors not conditioned w/ indicators changing on their own

    I've got a subfile screen and some of the text labels are changing from white to green when I page down to the bottom of the subfile. They are NOT conditioned with indicators. I don't have any fields that start in position 1 or end in position 80. I'm really quite baffled here. I've attached print screens and the code. Any help is appreciated. (Please don't bash me for using ILE, my job won't let me use /free)

    edit: it swapped the pictures when I uploaded. The second one is how it's supposed to look. The first one is the "bad" one.

    Code:
     *****************************************************************
    A          R VIEW1SFL                  SFL                        
    A  74                                  SFLNXTCHG                  
    A            RRN1           4S 0H                                 
    A            VXCUST#        7   H                                 
    A            VXQUOTE       10   H                                 
    A            VXWHS          3   H                                 
    A            VXOPTION       1   B  4  2                           
    A  75                                  DSPATR(PC)                 
    A  73                                  COLOR(RED)                 
    A  73                                  DSPATR(RI)                 
    A            VXALSO         7   O  4  4                           
    A            VXCUSTNAM     14   O  4 12                            
    A            VXDATE         6  0O  4 27EDTCDE(Y)                   
    A            VXSTATUS       5   O  4 36                            
    A            VXSHPQTY       5  0O  4 42EDTCDE(L)                   
    A            VXVALUE        8  2O  4 49EDTCDE(J)                   
    A            V1CUSTPO      19   O  4 61                            
     *                                                                 
     ***************************************************************** 
     *                                                                 
    A          R VIEW1CTL                  SFLCTL(VIEW1SFL)           
    A                                      OVERLAY                    
    A                                      CSRINPONLY                 
    A  72                                  SFLDSP                     
    A N70                                  SFLDSPCTL                  
    A  70                                  SFLCLR                     
    A  71                                  SFLEND                     
    A                                      SFLSIZ(0020)               
    A                                      SFLPAG(0019)               
    A                                      RTNCSRLOC(&RECORD &CSRFLD) 
    A            RRN1           4S 0H      SFLRCDNBR                  
    A            SCROLLRRN      5S 0H      SFLSCROLL                  
    A            RECORD        10   H                                 
    A            CSRFLD        10   H                                 
    A                                  1  2'Whs'                      
    A                                      COLOR(WHT)                 
    A            VXWHSFILT      3   B  1  6                           
    A  51                                  DSPATR(PC)               
    A  51                                  COLOR(RED)               
    A  51                                  DSPATR(RI)               
    A                                  1 10'Loc'                    
    A                                      COLOR(WHT)               
    A            VXLOCFILT      3   B  1 14                         
    A  52                                  DSPATR(PC)               
    A  52                                  COLOR(RED)               
    A  52                                  DSPATR(RI)               
    A                                  1 18'SP'                     
    A                                      COLOR(WHT)               
    A            VXOSPFILT      2   B  1 21                         
    A  53                                  DSPATR(PC)               
    A  53                                  COLOR(RED)               
    A  53                                  DSPATR(RI)               
    A                                  1 24'ISP'                    
    A                                      COLOR(WHT)               
    A            VXISPFILT      3   B  1 28                            
    A  54                                  DSPATR(PC)                  
    A  54                                  COLOR(RED)                  
    A  54                                  DSPATR(RI)                  
    A                                  1 32'FOB'                       
    A                                      COLOR(WHT)                  
    A            VXFOBFILT      1   B  1 36                            
    A  55                                  DSPATR(PC)                  
    A  55                                  COLOR(RED)                  
    A  55                                  DSPATR(RI)                  
    A N40                                  DSPATR(UL)                  
    A  40                                  DSPATR(PR)                  
    A                                  1 38'PCL/LTL'                   
    A                                      COLOR(WHT)                  
    A            VXPCLLTL       1   B  1 46                            
    A  56                                  DSPATR(PC)                  
    A  56                                  COLOR(RED)                  
    A  56                                  DSPATR(RI)                  
    A                                  1 50'Value'                     
    A                                      COLOR(WHT)                  
    A            VXTOTLVAL     10  2O  1 56EDTCDE(J)                   
    A                                  1 73'ORDRVWP'                   
    A                                      COLOR(BLU)                  
    A            VXFRMDATE      6  0B  2  2EDTCDE(Y)                   
    A  57                                  DSPATR(PC)                  
    A  57                                  COLOR(RED)                  
    A  57                                  DSPATR(RI)                  
    A                                  2 11'to'                        
    A                                      COLOR(WHT)                  
    A            VXTODATE       6  0B  2 14EDTCDE(Y)                   
    A  58                                  DSPATR(PC)                  
    A  58                                  COLOR(RED)                  
    A  58                                  DSPATR(RI)                  
    A                                  2 23'Status'                    
    A                                      COLOR(WHT)                  
    A            VXSTSFILT      5   B  2 30                            
    A  59                                  DSPATR(PC)                  
    A  59                                  COLOR(RED)                  
    A  59                                  DSPATR(RI)                  
    A N41                                  DSPATR(UL)                  
    A  41                                  DSPATR(PR)                  
    A                                  2 36'Search'                    
    A                                      COLOR(WHT)                  
    A            VXSEARCH      37   B  2 43                            
    A  63                                  DSPATR(PC)                  
    A                                  3  2'X'                         
    A                                      DSPATR(UL)                  
    A                                      COLOR(WHT)                  
    A                                  3  4'Order #'                   
    A                                      DSPATR(UL)                  
    A                                      COLOR(WHT)                  
    A                                  3 12'Customer Name '            
    A                                      DSPATR(UL)                  
    A                                      COLOR(WHT)                  
    A                                  3 27'Date    '                  
    A                                      DSPATR(UL)                  
    A                                      COLOR(WHT)                  
    A                                  3 36'Stat '                     
    A                                      DSPATR(UL)                  
    A                                      COLOR(WHT)                  
    A                                  3 42'  Qty'                     
    A                                      DSPATR(UL)                  
    A                                      COLOR(WHT)                  
    A                                  3 49'     Value'                
    A                                      DSPATR(UL)                  
    A                                      COLOR(WHT)                  
    A                                  3 61'Customer PO        '       
    A                                      DSPATR(UL)                  
    A                                      COLOR(WHT)                 
     *                                                                
     *****************************************************************

    Code:
     * Process until user presses exit                                      
    c                   DOU       Fkey = F3                                 
    c                   write     foot                                      
    c                   SELECT                                              
    c                   WHEN      ShowView1                                 
    c                   exfmt     view1ctl                                  
    c                   WHEN      ShowView2                                 
    c                   exfmt     view2ctl                                  
    c                   ENDSL                                               
     *                                                                      
     * reset any errors                                                     
    c                   eval      *in51 = *off                              
    c                   eval      *in52 = *off                              
    c                   eval      *in53 = *off                              
    c                   eval      *in54 = *off                              
    c                   eval      *in55 = *off                              
    c                   eval      *in56 = *off                              
    c                   eval      *in57 = *off                              
    c                   eval      *in58 = *off                              
    c                   eval      *in59 = *off                              
    c                   eval      *in73 = *off                              
    c                   eval      vxerrmsg = *blanks                        
     *                                                                      
    c                   SELECT                                              
     *                                                                      
     * exit                                                                 
    c                   WHEN      FKey = F3                                 
    c                   leave                                               
     *                                                                      
     * prompt                                                               
    c                   WHEN      FKey = F4                                 
    c                   exsr      $Prompt                                   
     * change sort                                                          
    c                   WHEN      FKey = F10                                
    c                   SELECT                                              
     *                                                                      
    c                   WHEN      SortByCust                                
    c                   eval      SortByCust = *off                         
    c                   eval      SortByDate = *on                          
    c                   eval      *in61 = *on                               
     *                                                                      
    c                   WHEN      SortByDate                                
    c                   eval      SortByDate = *off                         
    c                   eval      SortByCust = *on                          
    c                   eval      *in61 = *off                              
    c                   ENDSL                                               
     *                                                                      
    c                   exsr      $Validate                                 
    c                   IF        NOT Invalid                               
    c                   exsr      $BuildSQL                                 
    c                   exsr      $LoadSFL                                  
    c                   ENDIF                                               
     *                                                                      
     * change view                                                          
    c                   WHEN      FKey = F11                                
    c                   SELECT                                              
     *                                                                      
    c                   WHEN      ShowView1                                 
    c                   eval      ShowView1 = *off                          
    c                   eval      ShowView2 = *on                           
    c                   eval      *in62 = *on                               
     *                                                                      
    c                   WHEN      ShowView2                                 
    c                   eval      ShowView2 = *off                          
    c                   eval      ShowView1 = *on                           
    c                   eval      *in62 = *off                              
    c                   ENDSL                                               
    c                   eval      rrn1 = scrollrrn                          
     * filters changed                                                      
    c                   WHEN      SaveHeadr <> ScreenHeadr                  
    c                   exsr      $Validate                                 
    c                   IF        NOT Invalid                               
    c                   exsr      $BuildSQL                                 
    c                   exsr      $LoadSFL                                  
    c                   ENDIF                                               
     * Options                                                              
    c                   OTHER                                               
    c                   exsr      $ReadSFL                                  
    c                   IF        Need2Reload                               
    c                   exsr      $LoadSFL                                  
    c                   IF        HoldRRN > TotlSFLRcd                      
    c                   eval      rrn1 = TotlSFLRcd                         
    c                   ELSE                                                
    c                   eval      rrn1 = HoldRRN                            
    c                   ENDIF                                               
    c                   ENDIF                                               
    c                   ENDSL                                               
     *                                                                      
    c                   ENDDO                                               
     *                                                                      
    c                   eval      *inlr = *on                               
     *                                                                      
     ********************************************************************** 
     ********************************************************************** 
     * $LoadSFL - execute SQL, load to the subfile                       
     ********************************************************************** 
     *                                                                      
    c     $LoadSFL      BEGSR                                               
     *                                                                      
     * Clear subfile                                                        
    c                   eval      *in70 = *on                               
    c                   eval      *in72 = *off                              
    c                   eval      rrn1 = 0                                  
    c                   eval      vxtotlval = 0                             
    c                   write     view1ctl                                  
    c                   write     view2ctl                                  
    c                   eval      *in70 = *off                              
    c                   clear                   view1sfl                    
    c                   clear                   view2sfl                    
     *                                                                      
    c/Exec SQL                                                              
    c+     PREPARE Stmt1 from :SQLCommand                                   
    c/End-Exec                                                              
    c/Exec SQL                                                              
    c+     Declare @C1 CURSOR for Stmt1                                     
    c/End-Exec                                                              
    c/Exec SQL                                                              
    c+     OPEN @C1                                                         
    c/End-Exec                                                              
     *                                                                      
     * read through results and load the subfile                            
    c/Exec SQL                                                              
    c+     FETCH @C1 INTO :vxalso,:WorkCustPO,:vxstatus,:v2carrier,:v2fob,  
    c+                    :WorkCName,:WorkEDate,:v2shpto#,:vxwhs            
    c/End-Exec                                                              
    c                   DOW       sqlcod = *zero                            
     *                                                                      
    c                   IF        v2shpto# = 0                              
    c                   eval      *in60 = *off                              
    c                   ELSE                                                
    c                   eval      *in60 = *on                               
    c                   ENDIF                                               
     *                                                                      
     * get qty and resale                                                   
    c                   eval      vxshpqty = 0                              
    c                   eval      vxvalue = 0                               
     * for quotes                                                           
    c                   IF        vxstatus = 'QUOTE' OR vxstatus = 'FTORD'  
    c     vxalso        chain     oordpoh2                                  
    c                   eval      vxvalue += pfr8                           
    c                   eval      vxtotlval += pfr8                         
    c                   eval      vxquote = pquote                          
    c                   eval      vxcust# = pcustn                          
    c     vxalso        setll     oordpod6                                  
    c     vxalso        setll     oordpod6                                  
    c     vxalso        reade     oordpod6                                  
    c                   DOW       NOT %eof                                  
    c                   IF        dpstat <> '9'                             
    c                   eval      vxshpqty += dpaqty                        
    c                   SELECT                                              
    c                   WHEN      dpum = 'M'                                
    c                   eval      vxvalue += dpaqty * dprsl * .001          
    c                   eval      vxtotlval += dpaqty * dprsl * .001        
    c                   WHEN      dpum = 'C'                                
    c                   eval      vxvalue += dpaqty * dprsl * .01           
    c                   eval      vxtotlval += dpaqty * dprsl * .01         
    c                   OTHER                                               
    c                   eval      vxvalue += dpaqty * dprsl                 
    c                   eval      vxtotlval += dpaqty * dprsl               
    c                   ENDSL                                               
    c                   ENDIF                                               
    c     vxalso        reade     oordpod6                                  
    c                   ENDDO                                               
     * for orders                                                           
    c                   ELSE                                                
    c                   eval      vxquote = *blanks                         
    c     vxalso        chain(n)  oordhdrs                                  
    c                   eval      vxcust# = custno                          
    c                   IF        fltfr8 <> 0                               
    c                   eval      vxvalue += tax + fltfr8                   
    c                   eval      vxtotlval += tax + fltfr8                 
    c                   ELSE                                                
    c                   eval      vxvalue += tax + fr8                      
    c                   eval      vxtotlval += tax + fr8                    
    c                   ENDIF                                               
    c     vxalso        chain(n)  oonrfl                                    
    c                   eval      vxcust# = custno                          
    c     vxalso        setll     oorddtls                                  
    c     vxalso        reade(n)  oorddtls                                  
    c                   DOW       NOT %eof                                  
    c                   IF        ordsts <> 'C'                             
    c                   eval      vxshpqty += qtyshp                        
    c                   SELECT                                              
    c                   WHEN      um = 'M'                                  
    c                   eval      vxvalue += qtyshp * rsl * .001            
    c                   eval      vxtotlval += qtyshp * rsl * .001          
    c                   WHEN      um = 'C'                                  
    c                   eval      vxvalue += qtyshp * rsl * .01             
    c                   eval      vxtotlval += qtyshp * rsl * .01           
    c                   OTHER                                               
    c                   eval      vxvalue += qtyshp * rsl                   
    c                   eval      vxtotlval += qtyshp * rsl                 
    c                   ENDSL                                               
    c                   ENDIF                                               
    c     vxalso        reade(n)  oorddtls                                  
    c                   ENDDO                                               
    c                   ENDIF                                               
     *                                                                      
    c                   eval      vxdate = %dec(%char(%date(WorkEDate:      
    c                                          *iso):*mdy0):6:0)            
    c                   eval      v1custpo = WorkCustPO                     
    c                   eval      vxcustnam = WorkCName                     
    c                   eval      rrn1 += 1                                 
    c                   write     view1sfl                                  
    c                   write     view2sfl                                  
     *                                                                      
    c/Exec SQL                                                              
    c+     FETCH @C1 INTO :vxalso,:WorkCustPO,:vxstatus,:v2carrier,:v2fob,  
    c+                    :WorkCName,:WorkEDate,:v2shpto#,:vxwhs            
    c/End-Exec                                                              
    c                   IF        sqlcod < *zero OR rrn1 = 9999             
    c                   leave                                               
    c                   ENDIF                                               
     *                                                                      
    c                   ENDDO                                               
    c/Exec SQL                                                              
    c+     CLOSE @C1                                                        
    c/End-Exec                                                              
     *                                                                      
     * nothing found                                                        
    c                   IF        rrn1 = 0                                  
    c                   eval      vxerrmsg = ErrMsgTxt(10)                  
    c                   ELSE                                                
    c                   eval      *in72 = *on                               
    c                   IF        rrn1 = 9999                               
    c                   eval      vxerrmsg = ErrMsgTxt(11)                  
    c                   ENDIF                                               
    c                   eval      TotlSFLRcd = rrn1                         
    c                   eval      rrn1 = 1                                  
    c                   ENDIF                                               
     *                                                                      
    c                   eval      *in71 = *on                               
    c                   eval      SaveHeadr = ScreenHeadr                   
     *                                                                      
    C                   ENDSR                                               
     *                                                                      
     **********************************************************************
    Attached Files
Working...
X