Print forms

Forms and their types are introduced in Form part. The current page outlines how to present print forms.

Print process

Printing is a two-step process:

In the case of multiform output, the print statements must be invoked in the order in which you want to present the forms. Consider the following example:

You can achieve that output by submitting a series of print statements that each operate on a print form. Those statements reference the forms in the following order:

  1. Top form

  2. Floating form, as presented by a print statement that is invoked repeatedly in a loop

  3. Bottom form

The symbols needed to start a new page are inserted in various circumstances, but you can cause the insertion by invoking the system function sysLib.pageEject before issuing a print statement.

Considerations for fixed forms

The following statements apply to fixed forms:

  • If you issue a print statement for a fixed form that has a starting line greater than the current line, EGL inserts the symbols needed to advance the print device to the specified line. Similarly, if you issue a print statement for a fixed form that has a starting line less than the current line, EGL inserts the symbols needed to start a new page.

  • If a fixed form overlays some but not all lines in another fixed form, EGL automatically inserts the symbols needed to start a new page and places the second fixed form on the new page.

  • If a fixed form overlays all lines in another fixed form, EGL replaces the existing form without clearing the rest of the output from the buffer. To keep the existing output and place the new form on the next page, invoke the system function sysLib.pageEject before issuing the print statement for the new form.

Considerations for floating forms

The following mistakes can occur if you are using floating forms:

  • You issue a print statement to place a floating form beyond the end of the floating area; or

  • You issue a print statement that at least partially overlays a floating area with a fixed form, then issue a print statement to add a floating form to the floating area.

The result in either case is that EGL inserts the symbols needed to start a new page, and the floating form is placed on the first line of the floating area on the new page. If the page is similar to the order-and-item output described earlier, for example, the new page does not include the topmost fixed form.

Print destination

When EGL processes a close statement to present a print file, the output is sent to a printer or data set. You can specify the destination at any of three times:

  • At test time (as described in EGL debugger)

  • At generation time (as described in Resource associations and file types)

  • At run time (as described in relation to the system variable sysVar.printerAssociation)

Related concepts
EGL debugger
FormGroup part in EGL source format
Form part in EGL source format
Form part
Resource associations and file types
Segmentation in text applications

Related reference
sysLib.pageEject
sysVar.printerAssociation