Information Technology Reference
In-Depth Information
line-counter
having a value of 5. This is needed because we have to count the lines that we print and
when we finish with the main title and the subheading, we will have accounted for five
lines. If you think it should be less than that, I'll get around to an explanation shortly. Our
next statement
print page main-heading
will go to the top of the page and print the structure
main-heading ,
which is the beginning of the report. If we don't use the keyword
page ,
the report could start in the middle rather than at the top. This keyword gets us a new
page on the printout. The next statement
print skip (2) sub-heading
will skip down two lines before it prints the subheading or structure
sub-heading .
This allows for two blanks line between the main title and the subheading. If you used the
print without the
skip
the subheading would print directly underneath the main heading. With
skip (1)
or equivalently,
skip ,
the subheading would follow a blank line after the main heading line. From the definition
of the heading line,
field character (5) value “Page”
results in Page followed by a space being printed. That space at the end separates the
literal from the actual page number on the title line. This usage is in the main-heading
structure as well as in the sub-heading structure. The statement
print-year character (48)
will result in the 01 followed by 46 spaces. This centers the title since the assign
statement
print-year = work-date (3:2)
will move the
01
to the variable
work-year
and the remaining 46 characters will be filled with spaces.
Getting back to assigning a value of five to
line-counter ,
the main heading line, two blank lines, a subheading line and another blank line would
have been printed, adding up to five lines. Note that when we print a detail line, we don't
include
skip,
Search WWH ::




Custom Search