× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



(Sorry for the second post David, first one when with wrong profile)
Prologue:

I have been programming in RPG for about 20 years (started with RPG II in 1985). After all the discussion about Uber-programmers and what a "real" programmer is, I am little reluctant to admit that I am not "classically trained" programmer, I have learned "seat of the pants". Perhaps that makes me a "goober-programmer".....Anyway, I have worked primarily with one vendor's product and also off the largess of those folks who have shared examples with me over the years. About a year ago I started down the RPG IV path and haven't looked back. But my lack of "core" RPG competency is starting to show. Here is the problem:

I have a program that I call that lists data values in a window where the user can select the value. I think I copied this example from a web site somewhere as an example of how to do this. The problem I am encountering is that when you page down past the end of the subfile records, the program closes. You never see the last page of records. I can't see any logic in the program that says to end, and the one place where last record IS set on and the program returns is not hit when I debug the program. So, I can't quite see why the program ends. What I prefer to have happen is to be able to page up and page down and not end the program until enter is pressed or F3 or F12.

It is a very simple program. I am just missing something and I think it is my understanding of how subfile processing works.

Thanks,

Pete Helgren

Code posted below:
DDS:

   A*%%TS  SD  20050628  212221  PETE        REL-V5R2M0  5722-WDS
   A*%%EC
   A                                      DSPSIZ(24 80 *DS3)
   A*
   A          R SFLA                      SFL
   A*
   A            LOCID     R        O  1  1REFFLD(LOCID   *LIBL/PFAS210)
   A            DESC          32A  O  1  8
   A          R FMT01                     SFLCTL(SFLA)
   A                                      CA12(12 'Cancel-12')
   A                                      CA03(03 'Exit-03')
   A                                      SFLSIZ(11)
   A                                      SFLPAG(10)
   A                                      WINDOW(10 10 10 45 *NOMSGLIN)
   A                                      ROLLUP
   A                                      ROLLDOWN
   A                                      OVERLAY
   A                                      SFLCSRRRN(&RRNA)
   A                                      SFLDSP
   A                                      SFLDSPCTL
   A  91                                  SFLEND(*SCRBAR)
   A                                      MOUBTN(*ULD ENTER)
   A            RRNA           5S 0H
   A          R DUMMY
   A*%%TS  SD  20050628  212221  PETE        REL-V5R2M0  5722-WDS
A TEXT('PREVENTS PREVIOUS SCREEN FROM-
   A                                      BEING CLEARED')
   A                                      ASSUME
A 5 9' '
RPG
   FWFTS210W  CF   E             WORKSTN
   F                                     SFILE(SFLA:RRNA)
   FPFAS210   IF   E             DISK
   C*  ..................................................
   C     *ENTRY        PLIST
   C                   PARM                    LOCID             6
   C                   Z-ADD     1             RRN               4 0
   C                   Z-ADD     1             RRNA
   C                   READ      PFAS210                                58
   C     *IN58         IFEQ      *ON
   C                   MOVE      *ON           *INLR
   C                   RETURN
   C                   END
   C* Fill the subfile:
   C     *IN58         DOWEQ     *OFF
   C                   MOVE      *BLANKS       DESC
   C                   MOVEL     LOCDES        DESC
   C                   Z-ADD     RRN           RRNA
   C                   WRITE     SFLA
   C                   ADD       1             RRN
   C                   READ      PFAS210                                58
   C                   END
   C     RRNA          IFGT      10
   C                   MOVE      *ON           *IN91
   C                   END
   C                   EXFMT     FMT01
   C     *IN12         IFEQ      *ON
   C     *IN03         OREQ      *ON
   C                   MOVE      *ON           *IN58
   C                   endif
   C* If a choice was made, save it to PARM for return:
   C     RRNA          IFGT      *ZEROS
   C     RRNA          CHAIN     SFLA                               54
   C                   END
   C                   MOVE      *ON           *INLR
   C*-------------------------------------------------------------------




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.