Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

keep option value in single page subfile

Posted on 2004-04-26
7
Medium Priority
?
755 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

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

We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
When trying to connect from SSMS v17.x to a SQL Server Integration Services 2016 instance or previous version, you get the error “Connecting to the Integration Services service on the computer failed with the following error: 'The specified service …
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

715 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