PxPlus User Forum

Twitter Twitter Twitter

Author Topic: Ending a Never-Displayed Panel  (Read 1793 times)

James Zukowski

  • Diamond Member
  • *****
  • Posts: 297
    • View Profile
Ending a Never-Displayed Panel
« on: January 08, 2019, 02:06:02 PM »
We've got a printer selection panel that we can flag to run in "Silent Mode" - a default selection is made, the open processing is executed, and returns to the calling program without displaying the actual panel.

Some of our calling programs will call this routine multiple times to create disk files instead of using an actual printer. While debugging some program mods, we noticed that one of our system files that gets opened for this panel doesn't seem to always be closed on exit, and sometimes dozens of channels are in opened for this single file.

The Pre-Display is to Perform ";Init_Prog"
The Post-Display (which in this case should not be used) is to Perform ";Start_Up"
The On Exit is to Perform ";Wrap_Up"

There are 2 system files opened in Init_Prog. If running in Silent Mode, the end of the Init_Prog routine GOSUBs to the open-printer routine, sets Cmd_Str$="END", then RETURNs.
The Wrap_Up simple closes the 2 system files, resets a global variable, and RETURNs.

The curious part of it all is that the 2 system are both opened and closed in adjacent lines, but only 1 seems to get closed -- most of the time. The channel variable names are PRT_FILE and FORM_FILE, with the latter being the one that seems to remain open.

For the debugging today, it seems to have been called about 1300 times, and left behind about 100-125 open files that should have been closed. Most of them were the FORM_FILE, with a handful of the PRT_FILE.

Has anyone run into anything like this before? Is there something that's not getting set correctly when bypassing the Display Panel process?

Thanks in advance for (1) reading through this, and (2) any suggestions you may have.
James Zukowski
Sr. Developer - J&E

BRAND>SAFWAY
Brand Industrial Services

James Zukowski

  • Diamond Member
  • *****
  • Posts: 297
    • View Profile
Re: Ending a Never-Displayed Panel
« Reply #1 on: September 12, 2019, 12:15:20 PM »
It seems that setting Cmd_Str$="END" will not execute the Panel's On-Exit logic if the panel is never actually created. Therefore, setting Cmd_Str$="END" in the Pre-Display logic would also require explicitly executing whatever On-Exit logic is needed, without relying on NOMADS to do it.
James Zukowski
Sr. Developer - J&E

BRAND>SAFWAY
Brand Industrial Services

Mike King

  • Diamond Member
  • *****
  • Posts: 3811
  • Mike King
    • View Profile
    • BBSysco Consulting
Re: Ending a Never-Displayed Panel
« Reply #2 on: September 12, 2019, 05:31:40 PM »
You are correct -- if the initialization tell the system to exit the panel we ship the panel wrap up on the assumption that the program has decided NOT to run the panel.
Mike King
President - BBSysco Consulting
eMail: mike.king@bbsysco.com

David Reynolds

  • Member
  • **
  • Posts: 14
    • View Profile
Re: Ending a Never-Displayed Panel
« Reply #3 on: September 13, 2019, 10:24:03 AM »
Does that include skipping any automated system wrap-up like "Auto Close Files" as well, or does it just skip the developer defined On-Exit?