Roger Harman wrote:
I'd really like to see an article or other info on those OO
techniques.

Briefly consider a statement like:

report.object = rptOpen('XCD500');

Behind the scenes, rptOpen() creates a new instance of a report object and returns a pointer to it. The object has a bunch of properties (an integer for storing the number of pages, a string for storing the name of the output stream file that's created, and so forth). One or more HTML files associated with the report ID are loaded into memory, and parsed into records and fields.

Since you never know how many records or fields there may be in an HTML file, rptOpen() allocates memory dynamically for each, and links them together in a chain (linked lists).

The pointer returned by rptOpen() becomes a basis for referencing every other object in the chain.

In a program that generates multiple reports, you can call rptOpen() multiple times. New report objects are dynamically instantiated with each call.

rptClose() destroys all objects created by rptOpen() and frees related memory.

The thought process may be somewhat non-traditional, but RPG is still well suited for it.

Nathan.

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.