|
Dan, Consider this "Matt's better safe than sorry method". It may be totally unnecessary but it does work without causing problems. You may want to take a peek in the archives and FAQ's to see if there's any discussions on scoping. Matt -----Original Message----- From: Dan [mailto:dbcerpg@yahoo.com] Sent: Thursday, November 07, 2002 9:52 AM To: rpg400-l@midrange.com Subject: RE: subprocedure questions I'll go ahead and play by the "rules" and change this per your recommendation, but, originally, I changed only the DS name and kept the subfields in the both of the DS's the same. Does this mean that the two DS's occupied the same place in memory? I'm guessing not, because a DUMP run in the subproc shows different values for the subfields in question. The DUMP run from the main module shows junk in the subproc's variables. Interesting. It must be time to buy a book. TIA, Dan --- "Haas, Matt" <Matt.Haas@thomsonlearning.com> wrote: > Dan, > > If you look (and unless I mis-keyed something) both data structures > are the same except for the names. The reason for this was to give > the subprocedure it's own copy of the data structure to work with so > you don't run into problems with scope. I could have easily updated > the variables in MyDS directly, eliminating the need to even return > anything but that's a bad thing to do since it makes the code very > hard to debug, but this keeps it more modular so if you need to, it > can be broken out into a service program. > > Matt __________________________________________________ Do you Yahoo!? U2 on LAUNCH - Exclusive greatest hits videos http://launch.yahoo.com/u2 _______________________________________________ This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list To post a message email: RPG400-L@midrange.com To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/cgi-bin/listinfo/rpg400-l or email: RPG400-L-request@midrange.com 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-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.