×
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.
On 29/05/2009, at 4:34 AM, Kurt Anderson wrote:
In 6.1 IBM has introduced local F-Specs which appear between the P
spec and the D-spec with the PI and parms. This now pushes the
parameters deeper into the procedure. It would be nice if RPG was
enhanced to allow for a P-spec to house the PI (in addition to the D-
spec for sake of backwards compatibility). That way we could have
the parameters be the first thing in the procedure.
Why is this so different from what already happens in the mainline?
Files are declared before the D-specs containing the PI for the
program itself (or before the C-specs containing the *ENTRY PLIST if
you're still using that method).
Look at CL. First thing you have (after comments) are your
parameters if you have any. That's pretty nice. RPG once required
them way down in the C-specs, then gave us the option to list them
in the D-specs, which I really liked. But ultimately, if the
parameters appeared at the beginning of the procedure (as they do in
CL, C++, Java), I think the presentation of code would flow smoother.
You need to rethink what you're really asking for. Firstly, CL only
NAMES (i.e., declares) the parameters on the PGM command. the
parameters themselves are defined later in the code on a DCL command
along with all the other variables used in the program. Java, C (and
its derivatives) and others both declare and define parameters in the
function interface (unless you adopt the ugly and rather stupid K&R
convention for C).
So do you want it like CL where you only name the parameters on the P-
spec and have a later D-spec to define them, or like Java where you
define the parameters on the P-spec? How would the P-spec look in each
of these cases? Where would any return value be defined? Currently,
ALL variables in an RPG IV program are defined on D-specs unless you
use the archaic support for C-spec data. You're asking that we now
have two places to define procedure variables and that seems messy.
While traditional RPG programmers see no difference between variables
and fields (i.e., from files) that's more a conceptual thing--it's
just what they're used to and RPG terminology reinforces that. RPG,
COBOL, CL, PL/1 and others have separate file definitions and variable
definitions. I think that's a good thing so I would not consider
separate F-specs as an argument for data definition on a P-spec. Thus
files defined in one place, variables defined in one place, and
parameters defined in one place.
I consider what you're asking for to be a nonsense request and you
shouldn't waste IBM's time by making them reject it.
Regards,
Simon Coulter.
--------------------------------------------------------------------
FlyByNight Software OS/400, i5/OS Technical Specialists
http://www.flybynight.com.au/
Phone: +61 2 6657 8251 Mobile: +61 0411 091 400 /"\
Fax: +61 2 6657 8251 \ /
X
ASCII Ribbon campaign against HTML E-Mail / \
--------------------------------------------------------------------
As an Amazon Associate we earn from qualifying purchases.