|
I was just thinking... Perhaps you could have a service program per file and as the first parm you would pass the operation and as the second parm a pointer to a DS and optionally a third parameter also a parm to a DS. The DS could be allocated dynamically by either the service program or the application but then you would be able to have arrays of objects and perform the action upon it via the parameter interface. My father used to say that any computer problem can be solved by throwing another level of indirection at it :-) Say you had a service program Called InvItem. This service program would support the following operations. New - This would allocate storage and return a pointer for the DS. Free - This would free the storage for the pointer passed in. Output - This would write the data from the DS to the datafile (either update or insert) This would have both pointer parms capable of being used or just the first. If you just used the first then you could potentially blast an existing record out of the water... This is ok sometimes. Write - This would only write the data from the DS to the data file (insert only) Would only use first pointer. Update - This would only update the data from the record. This would use both pointers to Data structures the first being the one that was returned to you and the second being the one where you had made changes. Delete - This would attempt to delete the record for the associated values in the data structure. Note SQL could be used for all these database functions and you would be able to do set at a time operations too. Get - This would return a record in the second pointer that matched the criteria in the first pointer. Next - After a get this would return the next record in the same place. Previous - After a get this would return the previous record. I am sure that there could be a lot of fun for someone in this :-) It would give us a sort of OO way of doing things. What do you all think? Eric +--- | This is the RPG/400 Mailing List! | To submit a new message, send your mail to RPG400-L@midrange.com. | To subscribe to this list send email to RPG400-L-SUB@midrange.com. | To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +---
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.