×
The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.
What you are looking for is a Linear Main program. In a Linear Main program, you specify a subprocedure to be your mainline code using the MAIN control spec keyword.
When your mainline is a subprocedure, on-exit works fine.
Have a look here
https://www.ibm.com/support/knowledgecenter/en/ssw_ibm_i_72/rzasd/cycvslinear.htm
Brian May
Director
Pre-Sales and Customer Solutions
Profound Logic Software
http://www.profoundlogic.com
937-439-7925 Phone
877-224-7768 Toll Free
November 12-14 . Orlando, FL
Three days of Profound Logic education with our experts!
Register now: info.profoundlogic.com/plus2019
-----Original Message-----
From: RPG400-L <rpg400-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of Greg Wilburn
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();
Return;
Just wondering if there is a way to do that in ONE line of code.
--
This is the RPG programming on IBM i (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit:
https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at
https://archive.midrange.com/rpg400-l.
Please contact support@xxxxxxxxxxxx for any subscription related questions.
Help support midrange.com by shopping at amazon.com with our affiliate link:
https://amazon.midrange.com
As an Amazon Associate we earn from qualifying purchases.