ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Reverse image a field - partially

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

  • Reverse image a field - partially

    Hi All,

    I am having a 15 character output field. This field should be reverse imaged on error condition. The problem is , the value need not be 15 characters all the time. it may be just 10 characters. In that case the entire field is getting reverse imaged but what i want is only the 10 characters to be RI. Blanks need not be reversed.

    Please help me out!

    Sudarshan
    Thanks
    Sudarshan

  • #2
    Re: Reverse image a field - partially

    Nope only the "field" is set to reverse image. There is no way of highliting only 10 characters of the 15 char field.

    Good Luck
    Bill
    "A good friend will bail you out of jail,
    A true friend would be sitting beside you saying,
    'Wow, that was fun.'"

    Comment


    • #3
      Re: Reverse image a field - partially

      well ... thats not exactly true ... you can use HEX codes to color sections of
      a field...now the issue is that the HEX code takes up one space...and
      you need two of them...one to turn on the RI and a second to Turn it
      OFF.. If your interested let me know I will post something

      Jamie
      All my answers were extracted from the "Big Dummy's Guide to the As400"
      and I take no responsibility for any of them.

      www.code400.com

      Comment


      • #4
        Re: Reverse image a field - partially

        Hi Jamie,

        I am dying with this issue!

        Please post me the solution.

        Thanks

        Sudarshan
        Thanks
        Sudarshan

        Comment


        • #5
          Re: Reverse image a field - partially

          see image for outcome!

          DDS
          Code:
               A*%%TS  SD  20080515  082351  FLANARY     REL-V5R4M0  5722-WDS
               A*%%EC
               A                                      DSPSIZ(24 80 *DS3                  -
               A                                             27 132 *DS4)
               A                                      INDARA
               A                                      CF01
               A                                      CF02
               A                                      CF03
               A                                      CF04
               A                                      CF05
               A N70                                  CF06
               A N70                                  CF07
               A                                      CF08
               A                                      CF09
               A                                      CF10
               A                                      CF11
               A                                      CF12
               A                                      CF13
               A                                      CF14
               A                                      CF15
               A                                      CF16
               A                                      CF17
               A                                      CF18
               A                                      CF19
               A                                      CF20
               A                                      CF21
               A                                      CF22
               A                                      CF23
               A                                      CF24
               A N41                                  PAGEDOWN
               A                                      PAGEUP
               A**************************************************************************
               A          R DUMMY
               A                                      ASSUME
               A                                  1  3' '
               A          R WIN1
               A*%%TS  SD  20080515  082351  FLANARY     REL-V5R4M0  5722-WDS
               A  *DS3                                WINDOW(5 10 5 40 *NOMSGLIN)
               A  *DS4                                WINDOW(5 10 5 40 *NOMSGLIN)
               A                                      WDWBORDER((*COLOR BLU) (*DSPATR RI)-
               A                                       (*CHAR '        '))
               A                                  3  2'Search:'
               A            AFIELD        30A  B  3 10
               A                                  5  2'F3=exit'
               A                                      COLOR(BLU)
               A                                  1  7'XXXXXXXXXXXXXXXXXXXXXXXXXX'
               A                                      DSPATR(HI)
          


          RPG
          Code:
                *---------------------------------------------------
                * Program - 
                * Purpose - 
                * Written -
                * Author  - 
                *---------------------------------------------------
               fRI15AD    cf   e             workstn INFDS(INFDS)
                *
                * Program Info
                *
               d                SDS
               d  @PGM                 001    010
               d  @PARMS               037    039  0
               d  @MSGDTA               91    170
               d  @MSGID               171    174
               d  @JOB                 244    253
               d  @USER                254    263
               d  @JOB#                264    269  0
          
                // Command Keys
          
               d Cmd01           c                   const(x'31')                         Cmd-1
               d Cmd02           c                   const(x'32')                         Cmd-2
               d LeaveProgram    c                   const(x'33')                         Cmd-3
               d Cmd04           c                   const(x'34')                         Cmd-4
               d Cmd05           c                   const(x'35')                         Cmd-5
               d Cmd06           c                   const(x'36')                         Cmd-6
               d Cmd07           c                   const(x'37')                         Cmd-7
               d Cmd08           c                   const(x'38')                         Cmd-8
               d Cmd09           c                   const(x'39')                         Cmd-9
               d Cmd10           c                   const(x'3A')                         Cmd-10
               d Cmd11           c                   const(x'3B')                         Cmd-11
               d Cmd12           c                   const(x'3C')                         Cmd-12
               d Cmd13           c                   const(x'B1')                         Cmd-13
               d Cmd14           c                   const(x'B2')                         Cmd-14
               d Cmd15           c                   const(x'B3')                         Cmd-15
               d Cmd16           c                   const(x'B4')                         Cmd-16
               d Cmd17           c                   const(x'B5')                         Cmd-17
               d Cmd18           c                   const(x'B6')                         Cmd-18
               d Cmd19           c                   const(x'B7')                         Cmd-19
               d Cmd20           c                   const(x'B8')                         Cmd-20
               d Cmd21           c                   const(x'B9')                         Cmd-21
               d Cmd22           c                   const(x'BA')                         Cmd-22
               d Cmd23           c                   const(x'BB')                         Cmd-23
               d Cmd24           c                   const(x'BC')                         Cmd-24
               d EnterKey        c                   const(x'F1')
               d RollUp          c                   const(x'F5')                         Roll Up
               d RollDown        c                   const(x'F4')                         Roll Down
          
               d Infds           ds                                                       INFDS data structure
               d Choice                369    369
               d Currec                378    379I 0
          
                *
                * Variables
                *
          
               d Normal          c                   X'20'
               d RI              c                   X'21'
               d Red             c                   X'28'
               d White           c                   X'22'
               d Blue            c                   X'3A'
               d Pink            c                   X'38'
          
          
               d EndScreen1      s              1    inz('N')
                *---------------------------------------------------
                *       C a l c u l a t i o n  S p e c s
                *---------------------------------------------------
               c                   exsr      $Screen1
                *
               c                   eval      *INLR = *on
                *===========================================
                *  $Screen1 - Display all parts allow for
                *             Search.
                *===========================================
               c     $Screen1      begsr
                *
               c                   eval      afield = Red + 'Red'      +
               c                                      White + 'White'  +
               c                                      Blue  + 'Blue'  + Normal
               c                   reset                   EndScreen1
               c                   dow       EndScreen1 = 'N'
                *
               c                   exfmt     WIN1
                *
               c                   select
                *
                * F3 pressed end the program F3 = LeaveProgram
                *
               c                   when      Choice = LeaveProgram
               c                   eval      EndScreen1 = 'Y'
                *
                * F6 pressed load records from WKBRTNO
                *
                *  ENTER key has been pressed.
                *
               c                   when      Choice = EnterKey
               c                   endsl
                *
               c                   enddo
                *
               c                   endsr
          
          Attached Files
          All my answers were extracted from the "Big Dummy's Guide to the As400"
          and I take no responsibility for any of them.

          www.code400.com

          Comment


          • #6
            Re: Reverse image a field - partially

            I'm so proud of your use of a modal. Very nicely done jamie. Pretty soon this site will have all the bells and whistles of my latest we app
            Your future President
            Bryce

            ---------------------------------------------
            http://www.bravobryce.com

            Comment


            • #7
              Re: Reverse image a field - partially

              red white & blue BABY!!!!!!
              All my answers were extracted from the "Big Dummy's Guide to the As400"
              and I take no responsibility for any of them.

              www.code400.com

              Comment


              • #8
                Re: Reverse image a field - partially

                One caveat (IIRC) -- if the field is input capable, the user might press a key which would overwrite the byte for the hex code and this would modify the situation. I'll play around with that to test my theory/recollection -- unfortunately, need to take care of another issue at the moment. Will post back asap.
                http://www.linkedin.com/in/chippermiller

                Comment


                • #9
                  Re: Reverse image a field - partially

                  of course you could write over the hex.....
                  just write code to stop that...we are programmers ......

                  create a hidden field with the stored attributes and use that to refer
                  back to if field changed.

                  --or-- use the attribute keyword in DDS
                  Code:
                  A            ATR_DACONM     1A  P                            
                  A            CDES      R        O  1 26DSPATR(&ATR_DACONM)
                  and then you just need to put the hex char at the end of the string....
                  Last edited by jamief; May 15, 2008, 07:59 AM. Reason: spelling ;)
                  All my answers were extracted from the "Big Dummy's Guide to the As400"
                  and I take no responsibility for any of them.

                  www.code400.com

                  Comment


                  • #10
                    Re: Reverse image a field - partially

                    Thanks for answering that Jamie! Had never thought of your method to address that.
                    http://www.linkedin.com/in/chippermiller

                    Comment


                    • #11
                      Re: Reverse image a field - partially

                      I stand corrected and getting smarter thanx to others in the group.
                      The saying stands: Your not too old to learn.
                      Bill
                      "A good friend will bail you out of jail,
                      A true friend would be sitting beside you saying,
                      'Wow, that was fun.'"

                      Comment


                      • #12
                        Re: Reverse image a field - partially

                        I am....Im just not tooo old to find old source...It just takes longer now
                        All my answers were extracted from the "Big Dummy's Guide to the As400"
                        and I take no responsibility for any of them.

                        www.code400.com

                        Comment


                        • #13
                          Re: Reverse image a field - partially

                          Kiss you Jamie!

                          It worked !

                          Thanks a lot. I definetly knew , that , if i post it at evening , i will get the answers by my Morning.

                          I am so happy that i found CODE400 right from the start of my career.

                          Sudarshan
                          Thanks
                          Sudarshan

                          Comment


                          • #14
                            Re: Reverse image a field - partially

                            I am so happy that i found CODE400 right from the start of my career.
                            Me too Whether they like it or not
                            Your future President
                            Bryce

                            ---------------------------------------------
                            http://www.bravobryce.com

                            Comment

                            Working...
                            X