× 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: *ENTRY PLIST (was: RE: Pointer not set for location .....)
  • From: "Simon Coulter" <shc@xxxxxxxxxxxxxxxxx>
  • Date: Fri, 01 Jun 01 20:45:00 +1000


Hello Rob,

You wrote:
>if %addr(parm1)=*null
>* then don't touch this variable!
>I used this on a RPGLE program I used as a Command Processing Program with
>many optional parameters interspersed.

This code works for *ENTRY parameters and non-CONST parameters but will fail if 
CONST is specified because the RPG compiler will not let you take the address 
of 
an input-only parameter (it's too stupid to realise the address is simply being 
TESTED rather than assigned to a variable -- another thing to add to the 
growing 
list of stupidities in the RPG IV compiler).

>As far as I am concerned the only good use for %parms is if it is equal to
>the total number of parms available then you don't have to check each one
>individually.  Or, does it assume that if you send the last parm then you
>sent all?

You cannot pass only the first and the fifth parameters.  If you wish to do 
that 
then you must code place-holders using *OMIT (or dummy variables) for 
parameters 
2, 3, and 4 -- which is effectively what the command analyzer is doing when you 
don't specify a return variable.

If you use CONST parameters then you must use both techniques.  Firstly you 
check whether something was passed using %PARMS and then you check whether what 
was passed is not null using the Test Argument API.  You cannot simply invoke 
the Test Argument API because it doesn't work reliably against *NOPASS 
parameters.

I use CONST on almost every parameter because it makes the interface much more 
flexible.

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   \ /   «»
«»                                                           X    «»
«»               ASCII Ribbon campaign against HTML E-Mail  / \   «»
«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»
+---
| 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.