Using the Destination for Formatting Text for Printing with Windows

Windows and window output functions can simplify the often frustrating task of printing independent groups of text in parallel columns. For example, on an invoice form, you may wish to have the "Ship To" address adjacent to the "Bill To" address. With standard string functions, this is relatively complex.

With Vermont Views, you can format independent groups of text side-by-side, or in any other desired arrangement, by placing windows of appropriate size in the desired locations on the screen and then using the window output functions to write the text into the windows. The windows can be borderless if boxes are not desired around the text. If you do want borders and your printer cannot print the block-graphics characters, use the borders BDR_DOTP or BDR_STARP.

A memory screen being used as a destination screen can be the buffer for another Vermont Views window, or it can be printed with ms_print().

The following steps illustrate one method for using sw_dest() for printing a page-sized memory screen. They are as follows:

1 Define one or more individual windows for formatting of text on the page. Define these windows to be the appropriate size and in the desired location for the page.
2 Define a memory screen of width appropriate to the width of the paper and of height appropriate to the text that is to be copied to the printer.
3 Use sw_dest() to map these windows to the memory screen.
4 Write the text to each window and put the window up. This updates the memory screen.
5 Print the memory screen. In this case, use a call to ms_print(), because we never defined a window that uses the memory screen as its buffer.


Home Contents Previous Next