|
Back in the day, when we found a serious error in a program such as a
missing config record, we would set on *INH1 and return. We didn't care
about exiting gracefully. We just wanted it to DIE immediately. Typically
these errors were so rare, that it wasn't worth the time to build the logic
for a graceful exit. When we got the H1, we would look at the code to see
why.
Now that we are using procedures instead of subroutines, the "return" just
exits the current procedure and returns to the calling procedure. It does
not exist the program. Consequently, the calling procedure doesn't know
that there was an error and it keeps running.
I know *INH1 is old school but it served the purpose. One of my work
arounds for this was to force a div by 0 as in var = var / (var - var) but
I have gotten some grief for that lately. What is the acceptable
replacement for this logic when using procedures? Again, we don't care
about a graceful exit. We only care that the program stops when it needs
to.
--
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@xxxxxxxxxxxxxxxxxxxx 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.
This mailing list archive is Copyright 1997-2024 by midrange.com 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].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.