× 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: How to prototype CL modules
  • From: bmorris@xxxxxxxxxx
  • Date: Tue, 18 Jul 2000 14:07:34 -0400




>Date: Tue, 18 Jul 00 11:24:37 +1000
>From: "Simon Coulter" <shc@flybynight.com.au>
> ...
>There are a few things wrong with your prototype:  ErrCode is not optional
for the
>QMHSNDPM API.  You should prototype the two optional parameter groups too.
Also from a
>style point of view ... putting names on the parameter definition IS A
GOOD THING!
> ...
>Here is my prototype for the same function.  I'd be interested in comments
and
>criticism:
> ...

Simon, since RPG doesn't allow you to group optional parameters (you can't
code anything to indicate "if parm 10 is coded, parm 11 must be coded
too"), then for APIs that have this type of optional parameter, I think you
should create more than one prototype:

D QMHSNDPM        PR                  EXTPGM('QMHSNDPM')
D  msgid                         7    CONST
 ... more basic parms
D  errCode                    1024    OPTIONS(*VARSIZE)

D QMHSNDPM_opt1   PR                  EXTPGM('QMHSNDPM')
D  msgid                         7    CONST
 ... more basic parms
D  errCode                    1024    OPTIONS(*VARSIZE)
 * optional parms group 2 begin here
D  callStkEntLen                10I 0 CONST
D  callStkEntQual...
D                               20    CONST
D  dspPgmMsgTime                10I 0 CONST

D QMHSNDPM_opt2   PR                  EXTPGM('QMHSNDPM')
D  msgid                         7    CONST
 ... more basic parms
D  errCode                    1024    OPTIONS(*VARSIZE)
 * optional parms group 1 begin here
D  callStkEntLen                10I 0 CONST
D  callStkEntQual...
D                               20    CONST
D  dspPgmMsgTime                10I 0 CONST
 * optional parms group 2 begin here
D  callStkEntType...
D                               10    CONST
D  msgDtaCCSID                  10I 0 CONST

Barbara Morris


+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com.
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com.
| 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.