Remove message from display file

Tags:
AS/400 Display File
Display File
RPGLE
Subfile
In my program I'm placing this message on the display after pressing page down again after the end of subfile has already been reached. When paging back up, control doesn't return to the program because the records exist in the subfile. How do I go about displaying this message, then removing it after the user begins paging back up? I am attempting to use SFLMSG/MSGLOC.
0

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Discuss This Question: 9  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • philpl1jb

    This is a another fine mess you've gotten us into Ollie.

    Rather than putting the bottom type message into your message file use the SFLEND(*MORE) DDS Keyword.  Turn on the related indicator when the sfl is full.  It will show the word "MORE" and when your at the bottom "BOTTOM" but it will cost you a little space below .. to the right of the SFL.



    54,090 pointsBadges:
    report
  • JohnGalt1776
    Thanks for responding Phil. I am already using SFLEND(*MORE) as well. IBM does both in the displays they use, i.e. results from WRKOBJ and the like, so I know it's possible, I just can't figure out how they're doing it. I've cloned this program from our ERP system whose screens all have the same issue of the "Already at bottom of area" message lingering after paging back up. I've looked at all the keywords for display files on IBM's Info Center and none stick out at me as a way to make it happen.
    35 pointsBadges:
    report
  • philpl1jb

    If you really want to do this ..

    The only way I can thing of is to change your logic to a page-at-a-time logic.  Then the page-ups and page-downs requests will be processed by your program and you can clear the message file. 

    If you find any other options let us know. 

    Good luck

    Phil

    54,090 pointsBadges:
    report
  • JohnGalt1776
    I'm already doing page at a time. The issue is that when you get to the bottom of the subfile, the preceding records you are paging up to are already there and so control never returns to the program and therefore I currently can't do anything about getting rid of the message. Even if I clear the subfile for each page, I don't know how I can reposition the file I'm reading to load the preceding records. Oh well.
    35 pointsBadges:
    report
  • philpl1jb

    No .. you're adding a page-at-a-time .. a growing subfile.

    Page-at-a-time the subfile is never more than one page long, the sflpage and sflsize are equal and your program would clear the subfile and load another page up or down with each press of the page-up/page-down key. It's a lot more code.

    54,090 pointsBadges:
    report
  • JohnGalt1776
    How can I reposition the file pointer for x number of records before where it is? Would I have to READPE x times, and then READE? If so, that's ridiculous.
    35 pointsBadges:
    report
  • philpl1jb

    Either you make an array of page#-keys to first record of page

    and fill the array as you read a page.  you put the actual pages into an array or you use readpe

    Here are some links

    https://itknowledgeexchange.techtarget.com/itanswers/page-at-a-time-subfile/


    http://www.code400.com/forum/showthread.php/11166-Page-at-a-time-subfile-with-SQL

    http://www.go4as400.com/Single-page-subfile-example-RPGLE/SFL-4.aspx?cid=44

    and that was pages 57-63 in "Essentials of Subfile Programming and advanced topics in RPG IV"

    @ Amazon

    12 Used from $17.15 

    8 New from $65.00                                             

    1 Collectible from $108.43

    Collectible!  Collectible!!  Wow, I thought like Henry David Thoreau I had the only collection of my book.






    54,090 pointsBadges:
    report
  • philpl1jb

    READP is probably the most frequent way to code the page-up. 

    My response should be along in awhile .. it contained links to a few solutions of the page at a time. I wouldn't buy the book listed in my posting .. no one else has and the author doesn't get bupkis off it.  But life goes on. 

    54,090 pointsBadges:
    report
  • Splat
    JohnGalt1776, if you use the last record displayed in the subfile to position for a page-down (roll-up) and the first record displayed in the subfile to position for a page-up (roll-down) keeping track of your position is easy (hidden fields can be useful as can protected input/output capable fields). 

    READ & READP loops are easy & you only want to read as many records as there are lines in the subfile. 

    The fun part is storing selected options (I use a data queue in QTEMP but someone else may have a better suggestion).
    12,865 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: