PxPlus User Forum

Main Board => Discussions => Language => Topic started by: Jeffrey Ferreira on March 07, 2023, 10:16:30 AM

Title: *X Mnemonic / Print Channel Timing Question
Post by: Jeffrey Ferreira 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

Title: Re: *X Mnemonic / Print Channel Timing Question
Post by: Allen Miglore 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.
Title: Re: *X Mnemonic / Print Channel Timing Question
Post by: Jeffrey Ferreira on March 07, 2023, 11:19:05 AM
Hi Allen,
thank you.
so closing the file (again) is not forbidden or bad.
jeff
Title: Re: *X Mnemonic / Print Channel Timing Question
Post by: Mike King 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. 
Title: Re: *X Mnemonic / Print Channel Timing Question
Post by: Jeffrey Ferreira on March 07, 2023, 04:32:30 PM
Thank you Allen and Mike. I appreciate it.