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



John M. Bauman wrote:

>I am in the early stages of my RPG IV and
>ILE development.  I want to make a call to
>a RPG IV program.  Both the caller and callee
>programs are RPGLE, compiled with the default
>activation group as *yes (OPM Compatible).
>Can I use a Procedure Interface in the
>"Callee" program?  If so why I am I seeing
>the error "Prototype for main procedure must
>be defined prior to Procedure-Interface
>definition".

This is one of those messages that means exactly what it says.  Procedures
are defined by 'PR' specs.  The 'PI' specs are the actual procedure code.
The 'PR' specs need to be in the code or the compiler can't validate that
your definition matches the caller's definition.  That's a horrid
oversimplification but it'll do for the nonce.

Here's a tiny example of what you're trying to do.  The source is member
AG07:

 * PI instead of *ENTRY
h debug dftactgrp(*yes) option(*srcstmt: *nodebugio)
 * dbgview(*list)

dmain             pr                  extpgm('AG07')
d numberIn                      15p 5

d*ENTRY emulation
dmain             pi
d numberIn                      15p 5

c                   if        %parms > 0
c     numberIn      dsply
c                   else
c     'Need number!'dsply
c                   endif

c                   eval      *inlr = *on

CALL AG07 with a number and again without any parameters to see it in
action.

Normally, I'd put the 'PR' section (2 lines of code) in a separate source
member so that all the other callers share the exact same definition.
Include it here and in the caller code by /copy qprotosrc,ag07 instead of
manually copying these into every caller that needs them.  And of course you
want a more meaningful name than 'main'!

Given this working example, you can start your research into the manuals
knowing one way to get the job done.  Strongly consider buying an RPG IV
book to accelerate your education.  If the book saves you 4 hours of lost
time tinkering it's paid for itself.

  --buck

"This box Rocks!" - related to 2002 NE IBM
Conference attendees by IBM's Stephanie Joy


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.