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



Another benefit of the prototype is that you can do stuff like
callp MyPgm(AnyVariable:SomeOtherVariable);
And those two variables do not have to be some variables in the PR
parameter list. In fact, the variable names in the PR parameter list can
be left off. They're just documentation - only the sizes, etc, are
important. Now, the variable names in the PI parameter list are
important, and used.

This is valid
D MyPgm PR extpgm('SCUZZLIB/ORDX56')
D 5a
D 15p 5

/free
callp MyPgm(var1 : var2);

Now in the called program, if you wanted to return a different parameter

D ORDX56 PI
D Parm1 5a
D Parm2 15p 5

/free
WorkVar=Parm1;
// manipulate WorkVar, or Parm1 some more
return;

You're rather limited.
- You can prevent them from modifying Parm1 by placing the CONST keyword
on it. (Which would also allow your calling program to do a
callp MyPgm('PLANA' : var2);
- You could use WorkVar to store the original value of parm1 and modify
and pass back the new value via parm1.

Now you could delve into ILE and really unleash the power.

Instead of
D MyPgm PR extpgm('SCUZZLIB/ORDX56')
D 5a
D 15p 5
/free
callp MyPgm(var1 : var2);
And in the called program,
D ORDX56 PI
D Parm1 5a
D Parm2 15p 5

You would have
D MyRoutine PR like(ResultField)
D 5a
D 15p 5
D ResultField S 5a
/free
ResultField=MyPgm(var1 : var2);
And in the called routine, from a Service Program, or bound module, versus
a program
D MyRoutine PI like(WorkField)
D Parm1 5a
D Parm2 15p 5
/free
WorkField=Parm1;
// Do some work on WorkField, like uppercasing it, etc.
return WorkField;

Understand?

So I guess one of the benefits of PR and PI to replace *entry plist is for
transitional education.

Rob Berendt

As an Amazon Associate we earn from qualifying purchases.

This thread ...

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.