Link to home
Start Free TrialLog in
Avatar of raj28
raj28

asked on

keep option value in single page subfile

Hello friends ,
I have done single page subfile program.
I have an option field where user can enter options for update(2) & delete(4) . I want to know how to keep those option values even after pagedown or pageup . i.e if i type 2 in second record line and if i do pagedown and then pageup the value should be there .
What is the best way to handle this ???
Thanks n waiting
Avatar of daveslater
daveslater
Flag of United States of America image

Hi
there are 2 ways, 1 is an array and the second is a Multi occuance data structure. You simply keey an index of where you are in the subfile and populate as necessary.

dave
Avatar of raj28
raj28

ASKER

Hi daveslater,
Can u pls give some code ...(also tell which is the best in performance and in simpliicity also )
Thanks n waiting
Hi
I would personally use and array (easier to code)  performance will not be an issue
is it RPG or RPGLE

Dave
Avatar of raj28

ASKER

hi.
rpgle
thanks n  waiting
ASKER CERTIFIED SOLUTION
Avatar of daveslater
daveslater
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of raj28

ASKER

hi dave,
how the option values are storing in array ?
Hi
somthing like
**************************************************************          
C     srSetArray    Begsr                                              
 ** Store values                                                        
C                   If        Idx > 1                                  
C                   EVAL      Idx=(Idx-sflrrn)-1                        
C                   FOR       RRN1=1 TO SFLRRN                          
C     RRN1          CHAIN     SFL                                      
c                   eval      idx = idx + 1                            
C                   EVAL      AryOption(idx)=SflOpt                    
C                   ENDFOR                                              
C                   ENDIF                                              
 **                                                                    
C                   ENDSR                                              

This would be called at the start of each roll subroutine