| 
 | 
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 mailing list archive is Copyright 1997-2025 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.