|
-----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.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.