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



On 24-Aug-2016 13:49 -0700, Barbara Morris wrote:
[…] Seems like it would be much easier, although much much less fun,
to just have a bunch of procedures, one for each basic data type,
with a zillion parameters all except the first *NOPASS, where all
the procedures look like this:

max = p001;
if %parms() >= %parmnum(p002) and p002 > max;
max = p002;
endif;
if %parms() >= %parmnum(p003) and p003 > max;
max = p003;
endif;
etc ...
return max;

That is quite similar to the "RPG source that could be used as a basis for a methodology to dynamically generate a MAX [or MIN] procedure that would accommodate a specific data type\size" I noted here:
[http://archive.midrange.com/rpg400-l/201608/msg00254.html]

Mine uses based storage to accomplish the task in a loop rather than having to code the "etc …" in the actual MAX calculations code, though of course has to expand the prototype and the initializations with a similar "etc …". If there were an ability to effect INZ(%ADDR(p###)), then the code would not even require a separate initialization phase.

Anyhow, the generic manner of that coding should make quite conspicuous to a reader, that the source code for such a procedure can be auto-generated for any given data-type\attributes. Because the code can be so easily /generated/ vs /coded/ [by hand], the "fun" is in coding what generates the code :-) The mundane stuff\coding is avoided, so there can be no worries about how tedious or un-fun for completing that task of writing the procedure(s).


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

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.