Control Break Programming

This term comes up five or six times in the book TheAwkProgrammingLanguage -- page 92 95 105 110 126

This book is old, 1988 (Making me much older) -- what pattern are they describing?

The gist is that they HaveThisPattern where they've read one thing too many, it told them they were past what they were looking for, and they put it back.

What's that in Pattern Parlance?

a curious -- ChrisGarrod


An old concept. It has to do with grouping and totaling. Say you want to report a list of sales for a given month along with daily totals. You sort the sales info by date. Start with the first record, print out the information, and keep on until you find a record whose date does not match the date you've just processed. At that point, you should have accumulated the sales totals for day one. Print those, clear the totals, and start up again with the current record.

Old-timers had to program a lot of this stuff by hand, but SQL and report writers can do it for you.

And boy was it a pain the tuchis! Not to mention all the little opportunities for mistakes to be made.


The "Natural" language, from Software AG, used with ADABAS database had syntax for this. As far as I can remember:

 READ DATABASE-FILE BY KEY-NAME FROM START-VALUE
  AT BREAK OF KEY-FIELD-NAME
   PRINT "SUBTOTAL"  SUBTOTAL "COUNT" COUNT
   SUBTOTAL = 0
  END BREAK
  PRINT FIELD2 FIELD3
  ADD FIELD3 TO SUBTOTAL
  ADD 1 TO COUNT
 END READ

Whew! I can remember much less than I thought, but that has the gist: there was a clause in the database read loop construct for changes in key field values.

A truly horrible language.

-- AndrewMcGuinness


This is also a term that applied back in the BadOldDays? of DOS programming, when the Pause key could be modified with the Control key to break a program's execution. This was used when a running program ran completely out of control. ControlBreakProgramming, in this context, referred to running your application until it hung in some sort of infinite loop, hitting Control-Break, fixing it, running it again, etc.

I don't know if this term was common, but it was the first thing I thought of when I saw this page. -- BrentNewhall


EditText of this page (last edited April 23, 2003) or FindPage with title or text search