Scott,
A valid question. It looks like this program that I'm trying to convert
calls the other program (which is a MAPICS user exit program, by the
way) multiple times, and the other program usually returns without
setting on LR. So it looks like, the last time it calls it, it checks
to make sure that the user exit program set on the LR indicator before
this calling program sets on LR and ends.
I agree, I could probably accomplish the same thing another way,
especially since the reason I'm converting this program to free-format
is that I want to make some major modifications to it. The existing
code is EXTREMELY hard to follow, so I'm trying to make it more readable
before I start changing the existing logic.
Mainly it just irks me that IBM didn't provide a simple way to convert
the existing logic directly to free-format -- that I would HAVE to find
a work-around.
No big deal -- if I have to, I have to. It's just an irritation. I
hate resulting indicators (and numbered indicators in general). This is
old, old RPG code -- I suspect that it was originally written in RPG II
because it also has a ton of GOTO and TAG combinations that I've been
trying to rewrite in structured code.
I appreciate all the suggestions from everyone (though I don't want to
have to modify the parameters in the MAPICS user exit program because
it's called from about a jillion other programs).
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Scott Klement
Sent: Wednesday, April 15, 2009 2:38 PM
To: RPG programming on the IBM i / System i
Subject: Re: How to Handle LR Indicator Return Situation In Free-Format
CALLP
Hi Sharon,
Can I ask a silly question? Why does it matter whether LR is on in the
called program? What will you do differently?
Perhaps you need to make it more abstract. Instead of relying on LR,
you could pass a parameter that signals, err... whatever it is that
you're trying to signal :)
In other words, you should try to focus on what your programs are trying
to say to each other, instead of focusing on whether they ended with
some arbitrary indicator turned on. Just my opinion.
Sharon Cannon wrote:
I'm trying to convert a fixed-format RPG program to ILE free-format.
Unfortunately, it has a CALL with an indicator in positions 75 and 76
to
check if the program returned with the LR indicator on. I want to
convert that CALL to a free-format CALLP, but I'm not sure how to
handle
that LR indicator situation.
Is there some way to use the program status data structure and check
for
a status of 00001?
It just irks me no end to have to leave that one section of the
program
in fixed format with a /end-free and a /free. Thanks in advance for
any
help you can give.
As an Amazon Associate we earn from qualifying purchases.