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



Rory Hewitt wrote:

However, since the extra parameter would be a simple string, I think I *
might* simply define a UDS (data-area data-structure) in the caller, set it
to my required value and then use OUT to update it prior to calling the
programs. Those called programs that need the value can simply define the
same UDS and it's immediately available to them. The caller will
automatically create it in QTEMP and lock it, so it's effectively a CONST
parameter. Same system for RPG/400 or CL programs, I'd guess.

I'm trying to think of drawbacks to this approach... any thoughts.


RPG doesn't allow a program to lock a data area even if the lock is for the same job. So your scheme wouldn't work if one of the called programs that needs the value calls another program that needs the value.

If you do use the data area, better to use IN and OUT to avoid keeping the lock.

Another approach is to use a service program to hold the value. The caller would call a procedure to set the value, and the called programs would call another procedure to get the value. This approach has the same split-interface problem that Simon mentioned for the data area approach, but it's more extensible than using a data area.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

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.