|
Scott, That's an Assert although assertions in other languages usually log when the condition fails and can get turned off when not debugging. So you'd code: Assert( X > 0 : 'X is not positive' ); which would do nothing if you're not in debug. Something similar is coding comparisons in functions to better document the comparison. Instead of passing in the comparison the details of the comparison are hidden in the function. For example instead of coding: If Flag = 'Y'; // Deleted? use a function with: If Deleted( Flag ); with the Deleted function: P Deleted B D Deleted PI N // returns an indicator value D Flag 1A Const /Free Return Flag = 'Y'; // return the result of the comparison /End-Free P Deleted E Paul -- Paul Morgan Senior Programmer Analyst - Retail J. Jill Group 100 Birch Pond Drive, PO Box 2009 Tilton, NH 03276-2009 Phone: (603) 266-2117 Fax: (603) 266-2333 "Scott Klement" wrote > For example, maybe I want to write a routine that will log a message to > the job log ONLY IF a particular condition is true. I could do the > following:
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.