|
Hi James -
> For the specific conversion program that you described, > personally I would not have given any serious > consideration to trying to do it with the cycle > and cycle-based level breaks. But the two concepts are by no means inseparable. By using The Cycle in an interactive program that doesn't use a primary file, I get an implicit "do until finished" loop that can effectively become the program's main event loop. And if (as in the present case) there is a primary file, I no longer have to care about explicitly reading the file and looping on EOF, as that's all implicit.
Personally ...1. I would not use the cycle in place of a loop. If the program isn't going to have a primary file, I wouldn't write it as cycle-based. That makes it harder to figure out what's going on for no particular benefit that I see.
2. I would not write a program with a primary (and possibly secondary) file(s) unless that gives me some significant benefit over coding it explicitly. I have a couple of standard ways of handling level breaks so I don't need the cycle for that.
The only things I can think of that are significantly easier with the cycle are things that involve looking ahead at the next record(s) in the file(s), which is matching records and look-ahead fields. Since look-ahead fields can only be used with program-described fields, that greatly limits their usefulness, and makes matching records to be, in my opinion, the one reason to use a cycle-based program.
Ken http://www.kensims.net/ Opinions expressed are my own and do not necessarily represent the views of my employer or anyone in their right mind.
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.