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



Brad,

If you use setters that way, where are the values stored? If these
subprocedures reside in a service program, you use the service program as
a sort of singleton object. I would prefer something like this:

reset MailData;
setValue(MailData :'fromAddress':'jclarkson@xxxxxxxxxxx')
setValue(MailData :'toAddress':'rhammond@xxxxxxxxxxx')
setValue(MailData :'subject':'Come drive the new Ariel Atom')
setValue(MailData :'message':message)
sendEmail(MailData);

It's almost like Java :-) (And I don't even like Java!)

Joep Beckeringh


From:

Bradley Stone <bvstone@xxxxxxxxx>

06-01-2015 23:13

Subject:

Re: Service programs, procedures, not sure what to do

One thing I've been doing lately for subprocedures instead of passing a
lot
of parameters (which can change over time) is using "setters" before
calling the real subprocedure.

An example is the ILE subprocedures I did for our MAILTOOL application.

Instead of sendEmail(fromAddr:toAddr:subject:message:......)

I use "setters" to set the value of values that can be used by the
subprocedure. The first parm in the setter is the value to set, the
second
is the actual value which is set up as a global field in the
module/service
program.

Inside the setValue() subprocedure is really just a large select
statement
that sets the values as they are passed in.

setValue('fromAddress':'jclarkson@xxxxxxxxxxx')
setValue('toAddress':'rhammond@xxxxxxxxxxx')
setValue('subject':'Come drive the new Ariel Atom')
setValue('message':message)
sendEmail();

This is a very high level explanation of how I do it, but so far it's
working quite splendidly.

Just something to think about if you're just starting out with
subprocedures.

ps.. I also prefix them according to their use, so these would all be
mailtool_setValue, mailtool_sendEmail, etc...

Just an idea while you take your exciting journey down the ILE road. :)

Brad
www.bvstools.com

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.