# FORM

Syntax:

Then: FORM formname
Then: FORM exp

FORM can also be used on the condition line to test whether the form was actually found:

If: not form
Then: [do something]

Version Ref: 4.8

Description:

Prints a form from within processing. (AUTOMATIC and INPUT processing only.)

Examples:

FORM lets you print forms conditionally; print one form instead of another; and print more than one copy of a particular form. If you have a set of output formats named SALES1, SALES2, SALES3 and so on, and you want to print different forms depending on the conditions. There are at least two ways to do this. First is to set up a series of conditional elements: if field 2, format number, contains "1," then print SALES1, if field 2 contains "2," then print SALES2, etc. The second way is to use an expression, and generate the format name from the contents of field 2:

Then: form "SALES" { 2

If field 2 contains "3," then SALES3 is printed.

To print more than one copy of a form, you'd write a loop:

Then: input aa(2,.0) "Print how many copies? "
loop If: aa gt "0"
Then: form "label"; aa=aa- "1"; goto loop

Any processing associated with the form (by virtue of having the same name as the form) is not done. Dummy fields in the input processing tables can be put on this form. For example, if field A on the input processing table is a date field, and field A on the output processing table is a YESNO field, the field that appears on the printed form will be a date and not a YESNO.

Hint: If you have a need to create a form quickly, you can copy a screen by using the "Extended Functions - Import Text File" feature in "Define Output". Keep in mind that you will have to remove the non-text portions of the screen and change "%" field indicators to either exclamation points or asterisks to properly print a form version of your screen.