Information Technology Reference
In-Depth Information
meaning there are no blank lines between detail lines, but there is a blank line preceding
the very first detail line on every page. Also note that a check i s done before we print a
detail line to see if it's time for headings. This is determined by checking the variable
line-counter .
First we print the headings and set that field equal to 5. Whenever we print a detail line
we increment
line-counter
by 1 in the statement:
line-counter = line-counter + 1
When the counter gets to be greater than 54, it's time for a new set of headings so we'll
perform the
print-headings
paragraph and return. Since the counter is initially 54 and we just added 1 to
line-counter ,
we perform the heading routine before printing the first detail line, rather than printing the
heading after starting the program. Note that once we print the headings we have to reset
line-counter
or else we will have headings for every account number, which we don't want.
We have a slight variation in the line
if acct-status not = 9 ,
which introduces the logical operator
not .
As we proceed through the file, the status might be greater than 0. A value of 9 will
indicate the end of the file. If we get a value other than this, there is a problem, so we will
move an error message to the field
error-msg
and end the program.
That does it for our report program. Note that our original program had a few
things missing but we took care of those. You can also see that there appears to be two
different ways of doing the same thing. If you work on a PC, you will note that this is also
the case and most systems do allow a great deal of flexibility. You can choose how you
handle a particular situation and either way should get you what you want.
Search WWH ::




Custom Search