PxPlus User Forum
Main Board => Discussions => Language => Topic started 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
-
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.
-
Hi Allen,
thank you.
so closing the file (again) is not forbidden or bad.
jeff
-
Jeff
No, you can safely close the file in your *X logic. The system checks for this and handles it appropriately.
-
Thank you Allen and Mike. I appreciate it.