ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

cursor problems

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

  • cursor problems

    hi,
    I am having problems with position cursor
    I useed the SRLOC(LIN POZ) and dspatr(pc) with an indikator for errors

    when the indikator is on, the cursor set on another point.
    how can i solve it?

    thanks
    rachel

  • #2
    Re: cursor problems

    If anyone cares here in Illinois its finally going to hit 80 F (all day)
    and dont ask why I didnt take a vacation day


    Rachel,

    Would you please post the DDS along with code snippets of your RPG program.
    This will aloow us to better help you.


    Take care
    Jamie "stuck inside" F.
    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


    • #3
      Re: cursor problems

      hi Jamie

      the dds is build from 2 records and 1 subfile

      Code:
                R FMR2                                                  
                                            OVERLAY                     
                                            RTNCSRLOC(&RCDPOZ &FLDPOZ)  
                                            CSRLOC(LIN        POZ)      
                  RCDPOZ        10A  H                                  
                  FLDPOZ        10A  H                                  
                  LIN                 3S 0H                                  
                  POZ                3S 0H                                  
                  f1                    3S 0H                                  
                  f2                    7Y 0B  8 36DSPATR(HI)                  
        33                                  DSPATR(PC)                  
                                            EDTCDE(2)                   
      
      
               R FM01                      SFL               
                 TXT1          80A  H                        
                 TXT2          79A  H                        
                 f1                 8Y 0H                        
                 f2                 4Y 0H                        
                 f3                50A  O 16  2DSPATR(HI)        
                 f4                 4Y 0O 16 54DSPATR(HI)        
                               
                              
               R FM02                      SFLCTL(FM01) 
                                           SFLSIZ(0004) 
                                           SFLPAG(0003) 
                                           CF01(01)     
                                           CF03(03)     
                                                      OVERLAY                    
      N72                                  SFLDSP                     
                                           SFLDSPCTL                  
       72                                  SFLCLR                     
       92                                  SFLEND                     
                                           RTNCSRLOC(&RCDPOZ &FLDPOZ) 
                                           CSRLOC(LIN        POZ)     
                 LIN            3S 0H                                 
                 POZ            3S 0H                                 
                 RCDPOZ        10A  H                                 
                 FLDPOZ        10A  H                                 
              f1                     1A  B 12 67DSPATR(HI) 
         30                                           DSPATR(PC) 
              f1                     1A  B 12 67DSPATR(HI) 
         31                                          DSPATR(PC)


      in the rpg i have a verify code for the input fileds
      an error seton the indicator

      Comment


      • #4
        Re: cursor problems

        which field is the cursor on and what indicator are you turning on?

        Why r u using CSRLOC?

        Thanks
        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


        • #5
          Re: cursor problems

          I don't know if this helps you but look at the attachment.
          Attached Files

          Comment


          • #6
            Re: cursor problems

            hi

            i am using the csrloc to return to the same record
            when i enter the subfile.

            for exmple,i want to seton *in33 when the input is wrong,
            but the cursor set on another point


            thanks
            rachel

            Comment


            • #7
              Re: cursor problems

              I really dont use csrloc so this is only a guess but you could add keyword
              A RTNCSRLOC(&#REC &#FLD) I believe there is a third parameter
              for position. then use keyword
              A SFLCSRRRN(&WHERE01)
              to get the line number then z-add these values back into your variables
              RTNCSRLOC(&RCDPOZ &FLDPOZ)

              Code:
                   A*-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=
                   A* SUB01: Subfile #01
                   A*        Selection of All Survey Question Type.
                   A*-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=
                   A          R SUB01                     SFL
                   A*
                   A                                      SFLNXTCHG
                   A            S01OPTN        1A  B  9  3
                   A  40                                  DSPATR(RI)
                   A  40                                  DSPATR(PC)
                   A            S01SPLF       10A  O  9  6
                   A            S01UDTA       10A  O  9 28
                   A            S01HTML        1A  O  9 40
                   A            S01PDF         1A  O  9 45
                   A            S01JNAM       10A  O  9 17
                   A*-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=
                   A*  SFL01CTL: Subfile Control for SUB01
                   A*-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=
                   A          R SUB01CTL                  SFLCTL(SUB01)
                   A*
                   A                                      SFLSIZ(0014)
                   A                                      SFLPAG(0013)
                   A                                      CF06(06 'Add')
                   A                                      CF12(12 'Cancel')
                   A                                      RTNCSRLOC(&#REC &#FLD)
                   A                                      OVERLAY
                   A                                      SFLCSRRRN(&WHERE01)
                   A  50                                  SFLDSP
                   A  51                                  SFLDSPCTL
                   A  52                                  SFLCLR
                   A  89                                  SFLEND(*MORE)
                   A            SCRRN01        4S 0H      SFLRCDNBR(CURSOR)
                   A            #REC          10A  H
                   A            #FLD          10A  H
                   A            WHERE01        5S 0H
                   A                                  2  2TIME
                   A                                      COLOR(BLU)
                   A                                      EDTWRD('0  :  :  ')
                   A                                  1  2DATE
                   A                                      COLOR(BLU)
                   A                                      EDTWRD('0  /  /  ')
                   A                                  1 71USER
                   A                                      COLOR(BLU)
                   A                                  2 71SYSNAME
                   A                                      COLOR(BLU)
                   A            S01CDAY        9A  O  1 11COLOR(BLU)
                   A                                  5  2'Type options, press Enter.'
                   A                                      COLOR(BLU)
                   A                                  6  4'2=Edit'
                   A                                      COLOR(BLU)
                   A                                  8  6'SPLF Name '
                   A                                      DSPATR(UL)
                   A                                      COLOR(WHT)
                   A                                  8  2'Opt'
                   A                                      DSPATR(UL)
                   A                                      COLOR(WHT)
                   A                                  3 69'DRPT001R/01'
                   A                                  2 26'Daily Reports SPLF Maintenance'
                   A            S01CNAM       30A  O  1 26
                   A                                  8 17'Job Name  '
                   A                                      DSPATR(UL)
                   A                                      COLOR(WHT)
                   A                                  8 39'HTML'
                   A                                      DSPATR(UL)
                   A                                      COLOR(WHT)
                   A                                  8 44'PDF'
                   A                                      DSPATR(UL)
                   A                                      COLOR(WHT)
                   A                                  6 12'4=Delete'
                   A                                      COLOR(BLU)
                   A                                  6 22'5=Display'
                   A                                      COLOR(BLU)
                   A                                  8 28'User Data '
                   A                                      DSPATR(UL)
                   A                                      COLOR(WHT)
              let me know if this helps
              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


              • #8
                Re: cursor problems

                thanks

                i will try it

                Comment

                Working...
                X