× 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.



I'm assuming you know that the dcl-pi inside a procedure is for that procedure, and as far as I know you can only have one of those.  Additionally, the name is optional. In fact, I declare it with the name *n, like so:

dcl-pi *n ind end-pi;

The declaration above is sufficient for any procedure with no parameters that returns an indicator.  I tend to have a few of those in my programs (isInteractive, for example).

So that being the case, just think of your mainline as the "wrapper" for your entire program.  Again, you can only have one of those, but there the benefit that you don't have to name it. So in your case, this would work:

dcl-pi *n;
Parm1 char( 1);
Parm2 char( 1);
Parm3 char( 1);
end-pi;


The big benefit to this being that this interface definition works for any program with the same parameters.

Just me being lazy, I guess.  :)

Joe

Trying to go all **free, all of the time. (Obviously, **free dictates that
we are on v7r1 and a recent TR.)

In source named TESTENTRY, I have the following:
**free
dcl-pi TESTENTRx;
Parm1 char( 1);
Parm2 char( 1);
Parm3 char( 1);
end-pi;
If Parm1 = Parm2 and Parm1 = Parm3;
endif;
dump(a);
*inLR = *on;

Originally, I named the procedure interface the same as the program object
(TESTENTRY), but then I wanted to test whether this was a requirement. Lo
and behold, the above compiles, albeit with a level 10 warning RNF3776
(External program on prototype for main procedure is not the same as
program being created.) I tested it with:
CALL TESTENTRY PARM(A B C)
and the dump shows the parameter values. Is this expected behavior?

Is each procedure (main or otherwise) allowed to define no more than one
procedure interface? I think the answer is yes, but if I'm wrong, can
someone provide an example?

- Dan



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

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

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.