PxPlus User Forum

Twitter Twitter Twitter

Author Topic: *X Mnemonic / Print Channel Timing Question  (Read 1998 times)

Jeffrey Ferreira

  • Diamond Member
  • *****
  • Posts: 176
  • I must have taken a wrong turn at Albuquerque.
    • View Profile
*X Mnemonic / Print Channel Timing Question
« on: March 07, 2023, 10:16:30 AM »
Hi All,

i'm trying to use *X mnemonic to print  to a text file and email to customer.
But i noticed that when I enter the call entry point the file is still open and locked for that matter.
I added another close inside of the call routine and that worked (i could access file).
But is this correct / good practice?

Jeff


Allen Miglore

  • Silver Member
  • ***
  • Posts: 38
    • View Profile
    • UnForm
Re: *X Mnemonic / Print Channel Timing Question
« Reply #1 on: March 07, 2023, 10:32:59 AM »
This aligns with the documentation. I found that the behavior changed way back at pvx 6.

'*X' (asterisk X) contains the pathname of a program to CALL on the closing of a channel. When a file is closed, PxPlus issues a CALL to the program/entry point specified by the contents of '*X'. This takes place just prior the file being actually being closed, allowing the program to alter the contents of the file if desired.

Jeffrey Ferreira

  • Diamond Member
  • *****
  • Posts: 176
  • I must have taken a wrong turn at Albuquerque.
    • View Profile
Re: *X Mnemonic / Print Channel Timing Question
« Reply #2 on: March 07, 2023, 11:19:05 AM »
Hi Allen,
thank you.
so closing the file (again) is not forbidden or bad.
jeff

Mike King

  • Diamond Member
  • *****
  • Posts: 3818
  • Mike King
    • View Profile
    • BBSysco Consulting
Re: *X Mnemonic / Print Channel Timing Question
« Reply #3 on: March 07, 2023, 04:18:52 PM »
Jeff

No, you can safely close the file in your *X logic.  The system checks for this and handles it appropriately. 
Mike King
President - BBSysco Consulting
eMail: mike.king@bbsysco.com

Jeffrey Ferreira

  • Diamond Member
  • *****
  • Posts: 176
  • I must have taken a wrong turn at Albuquerque.
    • View Profile
Re: *X Mnemonic / Print Channel Timing Question
« Reply #4 on: March 07, 2023, 04:32:30 PM »
Thank you Allen and Mike. I appreciate it.