Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

keep option value in single page subfile

Posted on 2004-04-26
7
Medium Priority
?
764 Views
Last Modified: 2008-03-10
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
0
Comment
Question by:raj28
  • 4
  • 3
7 Comments
 
LVL 14

Expert Comment

by:daveslater
ID: 10926218
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
0
 

Author Comment

by:raj28
ID: 10926235
Hi daveslater,
Can u pls give some code ...(also tell which is the best in performance and in simpliicity also )
Thanks n waiting
0
 
LVL 14

Expert Comment

by:daveslater
ID: 10926256
Hi
I would personally use and array (easier to code)  performance will not be an issue
is it RPG or RPGLE

Dave
0
Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

 

Author Comment

by:raj28
ID: 10926269
hi.
rpgle
thanks n  waiting
0
 
LVL 14

Accepted Solution

by:
daveslater earned 1000 total points
ID: 10926355
Hi the basic code would be

h                                                                      
 **************************************************************        
 ** Array to hold options                                              
DAryOption        S              1    Dim(32766)                      
DIdx              S              5  0                                  
 **************************************************************        
C     srRollf       Begsr                                              
 ** Initialsie subfile                                                
C                   Clear                   *in31                      
C                   WRITE     sflctl                                  
C                   Eval      *in31=*On                                
c                   Clear                   sflRRn                    
 **                                                                    
C                   Do        *Hival                                  
C                   Read      MyFile                                  
C                   if        %eof                                    
C                   Leave                                              
C                   endif                                              
 **                                                                    
C                   Eval      sflrrn=sflrrn + 1                      
 ** Set pervious option                
C                   Eval      idx=idx + 1                            
C                   eval      sflOpt=AryOption(Idx)                  
C                   Write     Sfl                                    
C                   ENDDO                                            
C                   ENDSR                                            
 **************************************************************      
C     srRollB       Begsr                                            
 ** Initialsie subfile                                              
C                   Clear                   *in31                    
C                   WRITE     sflctl                                
C                   Eval      *in31=*On                              
c                   Clear                   sflRRn                  
 **                                                                  
C                   Do        *Hival                                
C                   ReadP     MyFile                                
C                   if        %eof                                  
C                   Leave                                            
C                   endif                                            
 **                                                                  
C                   Eval      sflrrn=sflrrn + 1
 ** Set pervious option                
C                   Eval      idx=idx - 1                      
C                   eval      sflOpt=AryOption(Idx)            
C                   Write     Sfl                              
C                   ENDDO                                      
C                   ENDSR                                      

Dave
0
 

Author Comment

by:raj28
ID: 10926616
hi dave,
how the option values are storing in array ?
0
 
LVL 14

Expert Comment

by:daveslater
ID: 10926671
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
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Simulator games are perfect for generating sample realistic data streams, especially for learning data analysis. It is even useful for demoing offerings such as Azure stream analytics, PowerBI etc.
Your business may be under attack from a silent enemy that is hard to detect. It works stealthily in the shadows to access and exploit your critical business information, sensitive confidential data and intellectual property, for commercial gain. T…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Screencast - Getting to Know the Pipeline

877 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question