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



David,

The answer is it depends :)

By definition, the only data belonging to a procedure are its local
variables, which can't be changed by any other procedures. Also by
definition, it's up to the programmer to not only ensure that any
global variables are used correctly, but to define "correctly" in the
first place!

At 6.1, you can have local f-specs, prior to that the f-specs were
global to the module. So if you had two procedures which both
operated on a file and you wanted each to be independent, you could
place the procedures in different modules.

Going back to your example, having an F1_SAVE in the test program
which the test program uses to do it's own comparison is probably a
bad design. Instead, F1_SAVE could have been passed back into a
procedure in the service program to do the comparison "correctly".

Then again, IMHO if you're passing around a data structure with all
the fields out of the file, you're probably doing something wrong in
the place! The idea isn't to have procedures that mimic RPG's
READ/WRITE/CHAIN op-codes, but to have procedures that encapsulate
business logic. The only place such a design requires all fields from
a file is in the Cread/Read/Update/Delete maintenance program. Even
report programs normally need but a subset of fields. I usually have
a GetBasicList() procedure that returns DS-array of the "common"
fields.

Note: Monday was a holiday here in the US, which might explain the
lack on response from the list.

HTH,
Charles

On Tue, Sep 8, 2009 at 4:05 AM, David FOXWELL<David.FOXWELL@xxxxxxxxx> wrote:
Carel thanks but my messge was obviously not clear, judging from the number of responses.

To summarize :

How do you store the results of a test on a service program? Does one program execute the tests on all of the procedures one after another? How do you store the results and compare them with the previous test?

If the test program runs one procedure after another, how do you know that at the end of the test, procedure 2 hasn't touched the data of the first procedure?
--
This is the RPG programming on the IBM i / System i (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 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.