|
Rich, Many functions I've worked with (like some of the C routines) return non-zero values if an error occurs and zero if no error occurred. I follow that same practice with my procedures that return error indicators - *Off is ok, *On was an error. Using a SUCCESS constant is just another level of obfuscation which, IMHO, doesn't improve the code. I have to go track down where and how SUCCESS is defined to see how the DoW loop ends. I might be more inclined to reword the read_example() routine to something more like MoreRecords() which describes the returned indicator better. But MoreRecords() doesn't make it obvious that this routine is actually reading a record. ReadExample() describes what's going on in the routine but doesn't describe very well the indicator being returned. I'd rather split the function up into two parts for these two behaviours. One function does the read with no returned indicator. One function just tests for more records: ReadExample(); DoW MoreRecords(); // ... ReadExample(); EndDo; But this gets away from your coding of the one function to control the DoW loop. Paul
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.