Sure. Within your Ctl-opt, use the Main() keyword to define the startup procedure for your program. Then you can use On-Exit.


-----Original Message-----
From: Greg Wilburn [mailto:gwilburn@xxxxxxxxxxxxxxxxxxxxxxx]
Sent: Wednesday, June 26, 2019 1:01 PM
To: RPG programming on IBM i <rpg400-l@xxxxxxxxxxxxxxxxxx>
Subject: ON-EXIT for a Main program

I really like the on-exit for procedures... is there something similar for programs?

I'd rather not code a subroutine with *INLR=*ON and RETURN (along with my other stuff).

I'm looking to call a procedure anytime I need to end the program. I know I could do:

Callp MyProc();

Just wondering if there is a way to do that in ONE line of code.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2020 by and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].