Was this helpful?
DICT2 Example
The previous DICTIONARY report uses some margin tricks to accomplish what can perhaps more easily be accomplished with the block mode of Report-Writer. Instead of letting the margins and wrap‑around format accomplish the task of moving down the page, you can use the more natural .newline statement in block mode to do this. The DICT2 report is the same as the DICTIONARY report, except for differences in the .head and .foot for "word," and a slight change in the .detail section.
The changed statements are:
In the .header for "word," the report specification sets Report-Writer into block mode. This allows you to move down the page in a more orderly fashion than would otherwise be possible. The underlined word prints on the first line of the block. The newspaper‑style printing of the definition causes some number of lines within the block to be written, depending on the length of the definition. However, when it has finished printing, the current output line is the top line in the block. You are now ready to print the detail lines, which contain the keywords for a term.
Within the .detail section of the report, the specification statements cause Report-Writer to tab to column 80, and print the next value of "ref." The .newline statement moves the current output line down one line in preparation for the next value of "ref." Because it is in block mode, Report-Writer saves all text after the header for "word" until it encounters the .endblock statement.
The .end block statement in the .footer section for "word" prints out the current block containing the word, its definition, and a list of related keywords. A .newline statement adds another blank line.
The DICT2 report accomplishes the same output as the DICTIONARY report, but in a somewhat more natural fashion.
/* DICT2 - text example, using .BLOCK */
.NAME dict2
.OUTPUT dict2.out
.LONGREMARK
The DICT2 report shows an alternative set of formatting statements for
producing the same output as the DICTIONARY report. The DICTIONARY
report uses some margin tricks to accomplish what can perhaps more
easily be accomplished with the block mode of the Report-Writer. Instead
of letting the margins and wraparound accomplish the task of moving down
the page, within block mode, you can use the more natural .NEWLINE
statement. Differences between the two reports is limited to the ".HEAD
word" and ".FOOT word" and a slight change in the ".DETAIL" section.
.ENDREMARK
.QUERY
            select ddef.word, ddef.definition, dref.ref
            from ddef ddef, dref dref
            where ddef.word = dref.word
.SORT word, ref
.LM 0
.RM 100
.HEAD report
            .NEWPAGE 1
.HEAD word
            .NEED 3
            .BLOCK
            .UL .PR word(c25) .NOU
            .PR definition(cj0.50)
.DETAIL
            .T80 .PR ref(c20) .NL
.FOOT word
            .END BLOCK
            .NL
.HEAD page
            .NL 2
            .P 'Dictionary of Ingres Terms'
            .RT .P 'Page', page_number .NL 2
            .UL .P 'Word' .T definition .P 'Definition'
            .T80 .P 'Related Term' .NOU .NL 2
.FOOT page
            .NL 3
Last modified date: 08/28/2024