Staying on the Same Subfile Page When Auto Refreshing

250 pts.
Tags:
RPG
RPGLE
I am doing an auto refresh. To do this, I created my display file using waitrcd(15), used maxdev(*file) for my workstn file and instead of using exfmt, I turned on the indicator which controls my INVITE, wrote to my subfile control record ,read from my display file and then turned my INVITE indicator off. I then checked the value of my *STATUS field to see if my WAIT time had expired.This is working beautifully except when it refreshes, it goes back to the 1st screen. I've tried using SFLRCDNBR and SFLCSRRRN but they don't work. My guess is it's because I'm not doing an EXFMT. How do I get it to stay on the same page when auto refreshing?
1

Answer Wiki

Thanks. We'll let you know when a new response is added.

I guess it is more a process flow problem than a screen handling problem. Your program probably returns control to your 1st screen if nothing change on your subfile. In that case, what I would try is after you read the display file and check *STATUS field to see if your WAIT time had expired, update the subfile record it without changing anything to it. That would tell your program that you still want to stay on your subfile screen.

______________
Taz

Discuss This Question: 3  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.
  • BigKat
    Try adding a INFDS to your display file F-spec FMYFILE CF E WORKSTN INFDS(DSPFBK) D DSPFBK DS D SF_RRN 376 377I 0 * Subfile rrn D MIN_RRN 378 379I 0 * Subfile min rrn D NUM_RCDS 380 381I 0 * Subfile num rcds I can never remember if it is SF_RRRN or MIN_RRN that contains the first subfile record visible, but that is the value to put in SFLRCDNBR.
    9,460 pointsBadges:
    report
  • Not4brett
    You need to enter the keyword infds(anyname) on the display file F spec on the RPG program . Then enter a DS structure naming it 'anyname'. Add a field called; D lastdsp 378 379B 0. When you return from either an exfmt or the 'read' timeout check the field. If it is zero the set the field named on the sflrcdnbr line on the subfile control to 1 and if not zero set the sflrcdnbr field to the lastdsp value. Initialize the named sflrcdnbr field to 1 the first time you display the subfile
    35 pointsBadges:
    report
  • PGMBOB
    BigKat and NOT4brett have the solution. If the subfile rolled several records the lastdsp will have the SFLRRN of he record at top of screen. I normally put this in the SFLRCDNBR field. You can say *PAGE or *TOP to return to the right record. I do this after control returns. When Editing needs to show a different page (page of the error) I plact THAT RRN into SFLRCDNBR Good Luck
    1,235 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: