× 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: Pointers, Parms, and all that (Was: DSPPGM API)
  • From: "Simon Coulter" <shc@xxxxxxxxxxxxxxxxx>
  • Date: Wed, 28 Apr 99 20:34:51 +1000

H
Hello Henrik,

Well, being pedantic (as is my wont), CL still requires the declared number of 
parameters to 
be passed.  The situation you are referring to occurs when a command is defined 
with 
parameters that specify RTNVAL(*YES) -- like all the RTVxxx commands.  The 
command analyser 
passes NULL pointers for the unspecified keywords so the command processing 
program still 
receives the correct number of pointers -- it just happens that some of the 
pointers have no 
storage allocated, hence the MCH3601 message that occurs when the parameters 
are referenced.

The primary difference between NULL parameters and the variable argument list 
of the original 
question is that a pointer is actually passed for the NULL parameter.  The 
variable argument 
list allows NOTHING AT ALL to be passed.  Note that it doesn't allow holes in 
the argument 
list i.e., if 5 arguments are declared then they must be consecutive from the 
first e.g., 1 or 
1 and 2 or 1, 2, and 3 etc but not 1 and 5.  For the situation you describe, 
knowing the 
number of parameters passed would not help; you really need to know which 
specific ones were 
passed.

RPG IV (and other languages) allows parameters to be omitted and ILE allows you 
to use the 
CEETSTA API determine exactly which parameters were passed and operational 
descriptors allow 
you to determine information about those parameters.  These should work for CLE 
programs but 
nothing will assist with CL programs (other than the afore-mentioned MONMSG 
MCH3601).

You probably know this but it may be educational to others.

Regards,
Simon Coulter.

«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»
«» FlyByNight Software         AS/400 Technical Specialists       «»
«» Eclipse the competition - run your business on an IBM AS/400.  «»
«»                                                                «»
«» Phone: +61 3 9419 0175      Mobile: +61 0411 091 400           «»
«» Fax:   +61 3 9419 0175      mailto: shc@flybynight.com.au      «»
«»                                                                «»
«» Windoze should not be open at Warp speed.                      «»
«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»
//--- forwarded letter -------------------------------------------------------
> X-Mailer: Microsoft Internet Mail 4.70.1155
> Date: Mon, 26 Apr 99 21:27:21 +0200
> From: "Henrik Krebs" <hkrebs@hkrebs.dk>
> To: MIDRANGE-L@midrange.com
> Reply-To: MIDRANGE-L@midrange.com
> Subject: Re: DSPPGM API

> 
> > Hello Jim,
> 
> > The API you are using IS the correct way to determine the number of
> parameters.  You are 
> > getting a range returned because RPG does not require you to pass all
> the parameters defined > on the *ENTRY PLIST.  This feature of RPG has
> existed since RPG III on System/38 (but I don't > know the first
> release).  It is a useful way of extending a programs function without 
> > breaking any existing code.
> >
> > Not all HLL's support this feature e.g., CL.
> 
> 
> 
> You do however need this feature inside a CL-program (and the AS/400 does
> it all the time): A command can 'call' a CL-program with maybe not a
> varying number of parameters but with 'null'-parameters. You can cope
> with this by monitoring for the genereted escape each time you refer to
> parameters that are not required.
> 
> Henrik

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