|
I wish I can discuss more but got too many projects at hand. ==> last post. Wouldn't it be easier to just put in the F spec, which will be auto opened by the program? Let those files stay open until user exit the program (*inlr = *on), which RPG auto closes them. Again, I don't see the advantage of having to populate the file handle datastructure, passing it around, and probably have to check for null before using it just in case something goes wrong. Again, RPG IO do those things automatically for you, why code them? -----Original Message----- From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]On Behalf Of Steve Richter Sent: Thursday, March 24, 2005 1:39 PM To: RPG programming on the AS400 / iSeries Subject: modular programming. was IBM's RPG Strategy (was: Long ProcedureNames) <clip> think of an order entry application. User enters the order info, then a central procedure opens the files, calls the procedure to validate the entry data, calls a second procedure to apply the data entry to the database. When the transaction is completed, the files are closed. Each procedure is passed the handles to the files they will be using. Too many handles? Create a data struct. Call it "OrderHandles". Add a subfield to the data struct for each file that your module of procedures will be working with. Now when you call the validation procedure you pass a reference to the handles data struct. Same thing when you call the other procedures to apply the entry to the database. To close the files, write a procedure that checks each handle for null. If the handle is not null, call the file close function to close the handle. <clip>
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.