× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Yesterday, I had a situation that was not only tailor-made for a Cycle program, but it seemed to also be tailor-made as an exercise to learn how to use control level breaks.

Consider FOO, a note file. Each record contains one 35-character "segment" of a "note"; each customer can have up to 10 separate notes, each with up to 100 segments.

Consider BAR, another note file. Each record is to contain all the notes for a particular customer, in a VARLEN field with a maximum capacity of just under 16k.

Now consider converting FOO to BAR. We go through the records of FOO, stringing together the "segments," separated by spaces, with a line break between "notes." Clearly a situation ideally suited for The Cycle, and seemingly also suited for the use of control level breaks.

Unfortunately, none of the permutations I tried using level breaks generated the correct sequence of segments, spaces, and line breaks. I finally threw out the I-specs defining the level breaks, and (except for a few statements at the end with LR as their level indicator, to stick the last buffer's worth of notes into the last record, and write it) replace all the level-break-sensing code with IF and SELECT blocks.

To those Cycle-haters who regard the whole "control level" business as a total waste of time, I agree. But note that the program in question is still a Cycle program, and there's no reason in the world to throw out The Cycle just because trying to make control level breaks do what you want them to do is harder than coding your own logic.

--
JHHL

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.