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



Whoa, thanks for the link and the code Dieter!

And those are good suggestions. I once did a couple of generic set() s with pointer passing and decided against it because that way loses all tracking of type and length and other relevant validation. Pointers are dangerous, tread carefully, but powerful when you use them right.

I have used service programs with procedures similar to the set(property:value) format but ONLY within the module, no *EXPORT necessary, and it was only for setting up an externally described data structure for writing out to the database (or updating it), in this case a control file record. But for the caller program, it had access to SetProperty(value) procedures.



-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of
D*B
Sent: Thursday, January 08, 2015 2:28 PM
To: RPG programming on the IBM i / System i
Subject: Re: Service programs, procedures, not sure what to do

... its a liitle bit offtopic for the OP, but...
@ set(property : value): the drawback of this aproach is: readability and you
loose all type checking of the compiler => I would not recommend this, it's a
bad practice!
@ the caller owns the memory: another rpg- typic bad practice! this aproach
destroys all encapsulation, the contents of the memory could be corrupted
by the caller => I would strongly recommend to avoid this!!!
@ multiple instances: you could define a DS instanceType based dummy
pointer, containing all "instance Variables" (:= all statefull information) then
you woul need a procedure new (a "Constructor") returning an instance (an
int as a handle), allocating storage for another occurence of a DS of
instanceType. Last not least you would have an additional parm int handle
for all exported procedures. For an example you could have a look to:
http://bender-dv.de/Sourcen/QRPGLESRC.APILIST .

@OP: I would start to forget Subroutines and using subprocedures instead.
Second step would be to forget the opcodes call and callb and to use callp
instead. When you habe incorporated this, next step would be to export
procedures. When this is managed, come bacjk to discussion about design of
modules and SRVPGMs.

D*B

--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L)
mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To
subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at
http://archive.midrange.com/rpg400-l.


--------------------------------------------------------------------------------
Confidentiality Notice: This email may contain confidential information or information covered under the Privacy Act, 5 USC 552(a), and/or the Health Insurance Portability and Accountability Act (PL 104-191) and its various implementing regulations and must be protected in accordance with those provisions. It contains information that is legally privileged, confidential or otherwise protected from use or disclosure. This e-mail message, including any attachments, is for the sole use of the intended recipient(s). Any unauthorized review, use, disclosure or distribution is prohibited. You, the recipient, are obligated to maintain it in a safe, secure and confidential manner. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message. Thank you.
--------------------------------------------------------------------------------



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.