Clearing a subfile screen

320 pts.
Tags:
Subfile
I have a load-all subfile that offers the user an Fkey to only display records that contain a predetermined value in a specific field. Here's the problem; If the user presses the Fkey and there are no records that contain the value required to select the record for display, I present the user with a message stating there were no records found but they are still looking at the records initially displayed, loaded before they pressed the Fkey. How do I clear the screen so the user does not see these initial records that now give them a conflicting situation - a message stating there are no records and a screen full of old records?
ASKED: January 22, 2008  4:36 PM
UPDATED: April 20, 2012  5:17 PM

Answer Wiki

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

Without knowing the sequence of IO operations you’re using it’s difficult to give a precise answer.

One approach would be to write a record format (perhaps the subfile control record but not the subfile itself) that is not using the OVERLAY keyword. Not having OVERLAY would cause the display image to be tossed. Another would be to rewrite the subfile control record and subfile after using SFLINZ. Or using SFLCLR and writing a ‘end of list’ subfile entry. There are really quite a few ways to get rid of that data — it just depends on what you want to end up with on the display device.

Bruce Vining
<a href=”http://www.brucevining.com/”></a>http://www.brucevining.com/

Discuss This Question: 7  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.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Floyd02
    Sorry, I should have added that my subfile is in a window with record selection including update and delete. Could I use a duplicate subfile control record without the overlay keyword since the main one does have the keyword in effect?
    320 pointsBadges:
    report
  • Floyd02
    I conditioned the Overlay keyword on the SFL control record to be off when there are no records to display. Now, my message stating there are no records displays above an empty SFL. The only problem now is the function key record is no longer displayed. This is better than what I had but I would like to see the Fkey record somehow.
    320 pointsBadges:
    report
  • Birddon
    You can use the ERASE keywords conditioned on when you don't display the subfile. Think of it as SFLCLR working in the virtual file and ERASE working on the screen in memory.
    45 pointsBadges:
    report
  • Sloopy
    The method I use is to create a format which overlays the subfile:
         A          R D@NDT1                     TEXT('No data in subfile')    
         A                                       OVERLAY PUTOVR                
         A                                 10 30' '                            
    Then, in the code:
    C                   Write     D@FOOT                                         Footer        
    C                   Write     D@MSGCTL                                       Messages      
    C  N14              Write     D@NDT1                                         No Subfile    
    C                   Exfmt     D@SF1C                                         Sfl Control screen 
    If 14 is OFF, there are (now) no records in the subfile, and the "no data" format overlays the subfile, which clears it off the screen. Regards!
    2,195 pointsBadges:
    report
  • Sloopy
    Wow, this text editor is savage! Er.... the code sample in my previous post has been mauled by the editor. It appears that the "@" symbol is taken to be an email address. Please look at it like this ("at" symbol replaced by #) :
    C                   Write     D#FOOT                                         Footer
    C                   Write     D#MSGCTL                                       Messages
    C  N14              Write     D#NDT1                                         No Subfile
    C                   Exfmt                                             Sfl Control screen 
    I hope that is clearer.
    2,195 pointsBadges:
    report
  • Floyd02
    Birddon, I don't know if your monitoring this thread any more due to it's age but I used your idea on another SFL where I had a SFLMSG being displayed on line 18 of a 24 line display, above the FKey's and below the last line of the SFL. Using the other methods described in this thread caused me to lose the SFLMSG and the FKey's. Your method of conditioning the ERASE keyword with the off indicator for the SFLDSP keyword worked perfectly, exactly what I was looking for - Thanks again.
    320 pointsBadges:
    report
  • XiaominJerry
    Writing the Control Record without the OVERLAY active did the trick - Thanks :-)
    10 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.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

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

Following