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



This method could be easily augmented to remove the use of global data by way of an additional Pointer parameter.

Ptr_cust = inventory_init();
inventory_setValue(Ptr_cust :'qtyLessThan':'10')
inventory_setValue(Ptr_cust :'itemType':'parishable');
inventory_listItems(Ptr_cust );

The caller defines the pointer and passes it to the Service Program Procedure.
Then all interaction with that instance passes along the pointer.
Allowing the pointer to act as a container of the "object" data.


I do find the idea of the setValue functions helpful for a service program like MailTool which would have many different options.

Although, I would probably end up creating a Helper procedure to wrap the calls to all the setValue procedures. This way I get one call that everyone can use and it contains all the parameters I would need with Options Omit/Nopass.

RDI has come a long way in matters of showing us the parameters required for a subprocedure. And even if that isn't working, we are usually only a few clicks away from looking at the prototype copybook.
So knowing the sequence of the parameters today shouldn't be an issue, depending on the tools you are using.

Also, you would have trouble setting this type of service program up as a SQL function without a procedure that includes all the parameters.

Chris Hiebert
Senior Programmer/Analyst
Disclaimer: Any views or opinions presented are solely those of the author and do not necessarily represent those of the company.


-----Original Message-----
From: MIDRANGE-L [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Bradley Stone
Sent: Tuesday, May 16, 2017 6:47 AM
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx>
Subject: Re: Service programs

One thing I like to do is use more generic procedures to set "parameter" values... ie:

function_setValue(parameter:value);

ie.
cstmst_setValue('custno':'993043');
cstmst_listOverdueInvoices();

or

inventory_setValue('qtyLessThan':'10')
inventory_setValue('itemType':'parishable');
inventory_listItems();

This way if you need to add parameters you simply update the
<function>_setValue() procedure and add new possible variables to set.
No change in signatures this way.

You could set up constants for the parameter names in the /copy files for the prototypes to make things easier as well.

Here's some documentation on just one application that I did it with:
http://docs.bvstools.com/home/mailtool/docs/chapter-3/-mailtool_setvalue

Because I've had this in production at many shops I've found it works great and wish I would have done this before with my other applications.
Bradley V. Stone
www.bvstools.com
Native IBM i e-Mail solutions for Microsoft Office 365, Gmail, or any Cloud Provider!



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.