× 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: rob@xxxxxxxxx
  • Date: Thu, 31 May 2001 16:12:50 -0500


And what happens if someone passes the fourth parameter and not 1-3?

Rob Berendt

==================
A smart person learns from their mistakes,
but a wise person learns from OTHER peoples mistakes.


                                                                                
                                        
                    rbaird@esourcecons                                          
                                        
                    ulting.com                To:     RPG400-L@midrange.com     
                                        
                    Sent by:                  cc:                               
                                        
                    owner-rpg400-l@mid        Subject:     Re: *ENTRY PLIST  
(was: RE: Pointer not set for location     
                    range.com                 .....)                            
                                        
                                                                                
                                        
                                                                                
                                        
                    05/31/01 02:16 PM                                           
                                        
                    Please respond to                                           
                                        
                    RPG400-L                                                    
                                        
                                                                                
                                        
                                                                                
                                        





Rob,

I use %parms a lot.  yes, in answer to your question - if the last parm was
passed, all were passed.

The way I use it is pretty foolproof, assuming there is only one version of
the program in use (with one copy of the source).

The reason I use it is when I'm adding parms to an existing program to add
functionality such as returning a value that wasn't returned before, change
the functionality in some other way.

consider this:   Pgm A has 3 parms and is called from 20 different programs
in the system.  all work fine as designed.   Now I'm writing Pgm B and I
want to perform the exact functions Pgm A is designed for.  But I also want
it to pass me additional information that it wasn't originally designed
for.   I then change Pgm A to perform this extra step, and return the new
value, but ONLY if %parms > 3.

No need to change any other programs.  Also, if someone is writing or
changing another program, they might find an example of calling Pgm A, or
they might even look at the source for Pgm A it doesn't matter, it will
always work for what they need it for (passing 3 or 4 parms even if they
pass 4 and never use the additional value)

If you wish to add more functionality to the pgm, just repeat the steps
above, and voila' - if %parms > 4 perform the new function (as well as the
last function).

No, not as slick or "new" as %addr but esentially serves the same purpose,
and I think is more intuitive as to what is meant.

Rick

original message:
Rob sez:
>> %PARMS again?
<snip>
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?-->>





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