|
rpg400-l-request@xxxxxxxxxxxx wrote: > 4. /if, /define, binder language (Richard B Baird) > >I'm a little fuzzy on the /IF and /DEFINE declarations. > >I remember seeing them discussed before, and I think they have something to >do with optionally defining portions of a copybook to your program...... > >am i right? what does it buy you other than the memory needed to define >these specific specs? Richard, one example... A lot of related APIs are used both for streamfiles and for sockets, others only make sense for streamfiles and still others only for sockets. Taking that a step further, some sockets APIs are useful when you're writing a server and others are useful for either server or client. In total, there's a LOT of prototypes in the whole bunch but you might only use a couple subsets in a given program. By using /if defined()/endif pairs in your copy module for these APIs and defining the sets of condition names that tell which parts you want, you can get a compiler listing that is less than a couple hundred pages long and half of it isn't wasted with references you don't need. A second example that I've used is to add report specs, expanded error procedures to do the printing and related definitions all blocked by /if defined(TESTING_ONLY)/endif pairs. Then when I compile for test runs, I define the TESTING_ONLY condition name and get the extra stuff added in. When I do the real production compile, the only change I have to make is to leave off the TESTING_ONLY condition name from the CRTRPGMOD command. In production, I don't have the extra stuff but it goes back in without changing a line of code. Lots of other ways to use this once you've seen it work. In short, if the condition name doesn't match, then the compiler effectively doesn't even see those blocked lines of code. Tom Liotta -- Tom Liotta The PowerTech Group, Inc. 19426 68th Avenue South Kent, WA 98032 Phone 253-872-7788 x313 Fax 253-872-7904 http://www.powertechgroup.com __________________________________________________________________ McAfee VirusScan Online from the Netscape Network. Comprehensive protection for your entire computer. Get your free trial today! http://channels.netscape.com/ns/computing/mcafee/index.jsp?promo=393397 Get AOL Instant Messenger 5.1 free of charge. Download Now! http://aim.aol.com/aimnew/Aim/register.adp?promo=380455
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.