|
On Fri, 25 Feb 2005 15:17:58 -0600 (CST), Scott Klement <midrange-l@xxxxxxxxxxxxxxxx> wrote: > > > > What about something simple like address book functionality? Vendors, > > Customers, and Employees all have the same core requirements of a name > > and address. In an OO language you would write the address book > > object once, then drop it in as a base struct in the vendor, customer > > and employee data struct. You cant do that in RPG ( or ILE ). > > Why can't you? I can code the following in RPG, isn't that what you're > talking about? > > D Address_T ds qualified > D Street 30A > D City 13A > D State 2A > D ZipCode 10A > > D Vendor ds > D Account# 4S 0 > D Terms 3A > D Contact 30A > D RemitAddr likeds(Address_t) > D SalesAddr likeds(Address_t) > D SupportAddr likeds(address_t) that is true. If I had v5r3 on my system I would make great use of sub field data structs. If the compiler was open sourced, struct member procedures would be the first feature I would add. To print an address label for the Vendor struct the programmer should be able to code the following: vendor.PrintLabel( ) ; the rpg way of: PrintAddressLabel( vendor.RemitAddr ) ; is too verbose. after someone from IBM posted the QleActPgmBnd and the QleGetExp api examples last week I was trying to work out how to implement virtual functions and interfaces in RPG and ILE. It was an interesting exercise. If you over allocate the space for your struct and place a pointer to a vtable in the extra space you can start to implement some virtual class features. But using just RPG it gets messy very quickly! -Steve
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.