|
David,--
I'm not sure I'm completely understanding either but I'll give it a shot.
By default all variables defined in a procedure are local. Therefore, P2 cannot touch data in P1. If, however, you are referring to fields from a file then those are global and could be touched by both P1 and P2. I don't have a good answer for how to keep them from updating the same fields. That sounds like more of a design issue to me.
Generally, I try to place all updates for a file into a single procedure. That way it is only updated in one place.
A new design we are just starting to work with is passing a data structure based on the file to a procedure that updates one or more values in the data structure and passes it back. After all the procedures have been called to perform the updates a procedure is called to actually update the file.
HTH,
Rick
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of David FOXWELL
Sent: Tuesday, September 08, 2009 3:06 AM
To: RPG programming on the IBM i / System i
Subject: RE: How to test a service program
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.
Privileged and Confidential. This e-mail, and any attachments there to, is intended only for use by the addressee(s) named herein and may contain privileged or confidential information. If you have received this e-mail in error, please notify me immediately by a return e-mail and delete this e-mail. You are hereby notified that any dissemination, distribution or copying of this e-mail and/or any attachments thereto, is strictly prohibited.
As an Amazon Associate we earn from qualifying purchases.
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.