• Subject: Re: CALL, CALLP, & CALLB
  • From: Dave Mahadevan <mahadevan@xxxxxxxx>
  • Date: Fri, 26 Feb 1999 18:00:07 -0500
  • Organization: Stoner and Associates

Hans:

It is always a pleasure to hear your crisp, concise explanations.  I have read
the RPG manuals but you are the best in the explanation.  Thanks and keep up
the good work.

boldt@ca.ibm.com wrote:

>
> First, CALLB is faster than CALL since it is calling something thats
> statically bound.
>
> CALLP is a replacement for both CALL and CALLB in that it can do both
> static and dynamic calls.  When you use CALLP, you must code a procedure
> prototype in your D-Specs.  On the prototype, you can define either
> bound or dynamic call linkage.  Keyword EXTPROC is used to specify bound
> linkage and EXTPGM is used for dynamic linkage.  (The default is bound
> linkage.)
>
> The main difference is that CALLP provides better error checking on the
> parameter types than CALL/CALLB.  It also provides additional function
> such as value and constant reference parameters.
>
> Programs that you call currently using CALL or CALLB can easily be
> called using CALLP by defining a prototype for that program.  Just look
> at the types of the fields defined in the *ENTRY PLIST for the program
> and define the parameters in the prototype to match.  Note that type
> checking on a CALLP is much more rigorous than on a CALL, so you have
> to be careful defining the parameters.  For example, if you want to be
> able to pass character fields of different lengths or arrays with
> different numbers of elements, you need to specify OPTIONS(*VARSIZE).
> If certain parameters are optional, you need to specify OPTIONS(*OMIT)
> or OPTIONS(*NOPASS).
>
> You don't have to change anything in the called program to be able to
> call it using CALLP.  If you want to take advantage of new language
> features, though, you could define a procedure interface for that
> program to replace the *ENTRY PLIST.  When adding new functionality,
> you could code that using sub-procedures.
>
> When defining the prototypes for a module, the approach we recommend is
> to place the prototypes for a module in a /COPY member.  Include that
> /COPY member in the modules source as well as the source files of all
> other modules that call procedures in that module.
>
> Cheers!  Hans
>
> Hans Boldt, ILE RPG Development, IBM Toronto Lab, boldt@ca.ibm.com
>

--
Thank You.

Regards

Dave Mahadevan.. mailto:mahadevan@fuse.net


* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* This is the RPG/400 Discussion Mailing List!  To submit a new         *
* message, send your mail to "RPG400-L@midrange.com".  To unsubscribe   *
* from this list send email to MAJORDOMO@midrange.com and specify       *
* 'unsubscribe RPG400-L' in the body of your message.  Questions should *
* be directed to the list owner / operator: david@midrange.com          *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *


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.