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


  • Subject: Re: Passing params between modules
  • From: "David Morris" <dmorris@xxxxxxxxxxxxx>
  • Date: Wed, 09 Jun 1999 10:12:08 -0600

Jocke,

I would bypass CALLB and use a prototype.  They you would use 
callp, eval, if, when, or any opcode that supports free format.  This 
gives much better control over your parameters.  You can find 
examples on News/400 and Midrange Computing's web pages.  
The following is a trivial example.

     D* Main procedure parameters (return value not valid)
     DProgram          PR
     D* Sub-procedure parameters
     DSubProc          PR            10A
     D PR_Input1                      5A   CONST
     D PR_Input2                      5A   CONST

... mainline for program

     C                   EVAL      Result  = SubProc(Input1: Input2)
     C                   RETURN

... sub-procedure called in program to append input2 to input2

     PSubProc          B
     DSubProc          PI            10A
     D Input1                         5A   CONST
     D Input2                         5A   CONST
     DReturnVal        S             10A
     C                   EVAL      ReturnVal = Input2 + Input1
     C                   RETURN    ReturnVal
     PSubProc          E

David Morris

>>> Jocke Berggren <jocke@fsys.se> 06/09/99 05:45AM >>>
Hia.

Im rather new at ILE-RPG and have just started doing some module
programming. Now I want the main program to call another module
with parameters and get a result back.

After I read the manuals I beelive CALLB is the way to call other modules
in the program but whats the best way to exchange data ?

Should I use *ENTRY PLIST or go with the keyfunctions IMPORT / EXPORT fields ?

_______________________________________
Jocke Berggren
FörlagsSystem

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


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.