FORMS Command

The FORMS command prints file items on such forms as invoices, checks, and order forms. Using FORMS allows you to explicitly position data either on the terminal or on a printer page according to x- (column) and y- (row) coordinates. FORMS prints one item per form.

Format

FORMS [DICT] filename [item-list] [selection] output  [modifiers] [print] [(options)]

Parameter(s)

DICT

Specifies the file dictionary.

filename

Name of the file.

item-list

List of individual item-IDs. Enclose each item-ID in single quotes.

selection

Specifies one or more conditions that an item must meet to be listed on a form. For a complete description of selection expression syntax, see the LIST Command.

output

List of attributes to be included in the report. output can also be a phrase that contains any INFO/ACCESS parameters except a command or a file name.

print

Specifies which values from MultiValued attributes are to be included in the report. Use relational operators and values immediately following the name of the MultiValued attribute. Enclose values in double quotes or backslashes.

modifiers

Include one or more keywords that modify the appearance of the form. These parameters affect headings, footings, and more. For complete information about modifiers, see the section, Connectives, Modifiers, and Options in the INFO/ACCESS User Reference Guide.

Following modifiers behave somewhat differently when used with forms generation commands: BREAK-ON, FOOTING, HDR-SUPP, HEADING, and ID-SUPP. These modifiers are described below in the section, Forms Generation Modifiers, in the INFO/ACCESS User Reference Guide.

options

Include one or more single-character codes that specify the report format and direct or modify output. They must be enclosed in parentheses, can be entered in any order, and need not be separated by spaces or any delimiters such as commas. For complete information about using these parenthetical options, see the section Connectives, Modifiers, and Options, in the INFO/ACCESS User Reference Guide.

In addition to the standard INFO-ACCESS options, the following three options are also available. These non-standard options are described further in the section, Forms Generation Options, in the INFO/ACCESS User Reference Guide.

A

Allows you to check printer alignment.

B

Prints a prestored background form along with the data specified in the FORMS statement.

Z

On multipage forms, resets footing page number to one.

Description

The FORMS command applies the format specified in the command line to the output specifications. FORMS prints one item per form; a form can be either single-page or multipage. Data can be printed anywhere on a page, and can be printed on just one page or on every page of a form. In addition to specifying how the data is to be printed on a form, the FORMS command can be used to specify the layout of the form itself.

The @W and @D print codes (described in the Print Codes section below) make it possible to define vertical windows in which the data for MultiValued attributes can be output. A form can contain up to six separate windows. If all of the data for a MultiValued attribute does not fit in a window, the remaining values are printed on the next page of the form.

The SFORMS command prints items or forms in sorted order. The REPT and SREPT commands can be used to print more than one item on a page.

Print Codes

Each attribute-name included on a form must be associated with a print code as follows:

@code (x,y [,z]) : attribute-name [1,n]

To define a character string that prints in a specified location on the form, use the following syntax:

Format

@code (x,y [,z]) : "string" [1,n]

Parameter(s)

code

Print code associated with the attribute. The available print codes are shown in the table below.

x

Horizontal position (column) on the page where the data begins. The leftmost position is column 0.

y

Vertical position (row) on the page where the data begins. The top row is row 0, which is reserved for the heading.

z

Extra data required by certain print codes.

attribute-name

Name of the attribute whose data is printed at the specified position.

string

A character string that is printed at the specified position.

n

Prints only the first n characters of the data for this attribute.

The following table summarizes the available print codes.

Print Code

Description

@ [A] (x,y)

Prints the data for an attribute on every page of a multipage form. The A is optional.

@C(x,y)

Creates an audit trail for a series of forms. The @C code can also be used to serialize the forms. To suppress serialization numbers on the form (but not in the audit file), specify (–1) in place of the x and y coordinates. (You must use either the x-y coordinates or –1 with the @C code.)

When you use the @C print code, the system prompts for the audit file and starting number:

Audit File>

Enter the name of an existing file that will be used to track each form that is generated.

Starting Number>

Enter the starting serialization number for the forms. This number appears on the form at the position specified for the @C-formatted attribute. The information on each form will be stored as an item in the audit file.

See the section Forms Generation, in the INFO/ACCESS User Reference Guide for more information about audit trails.

@D(x,y,z)

Prints data for MultiValued attributes in double-depth windows. This makes it possible to define two lines of output at a time. z specifies the bottommost row of a window whose topmost row is defined by y.

You must add an S to the end of the x parameter for an attribute to appear on every second output line.

@F(x,y)

Prints the data for an attribute on only the first page of a multipage form.

@L(x,y)

Prints the data for an attribute on only the last page of a multipage form.

@M(x,y,"text")

Prints the specified text on all but the last page of a multipage form. The data for the attribute prints on the last page of the form. On a single-page form, the data for the attribute is printed.

@W(x,y,z)

Prints data for MultiValued attributes in windows. x specifies the columns where attribute values are to start being printed. z specifies the bottommost row of a window whose topmost row is defined by y.

The system does not check whether output data exceeds the page width set by the TERM command. The justification (TP) of the specified attribute in combination with the maximum number of characters (MAX) and the column position (specified by x) determine the width of the data displayed on the form.

For complete information about using print codes, see the section Forms Generation, in the INFO/ACCESS User Reference Guide.

Forms Generation Modifiers

When used with forms generation commands, the following modifiers behave somewhat differently than they do with other INFO/ACCESS commands. For more information about how these modifiers work with forms generation commands, see the section Forms Generation, in the INFO/ACCESS User Reference Manual.

BREAK-ON

The data line for the BREAK-ON modifier is treated like any other output specification when it is printed.

Generally, forms generation commands will not use the BREAK-ON, TOTAL, and GRAND-TOTAL modifiers.

HEADING and FOOTING

Headings and footings cannot be output on a form using x-y coordinates; they are output in separate reserved areas. Conversely, data specified by the output parameter cannot be placed in the areas reserved for headings and footings. By default row 0 is reserved for headings and row 1 is reserved for a blank line that separates the heading from the report. If a multiple-line heading is specified for either headings or footings, the system reserves the number of lines needed for the text. The blank line is replaced by the specified multiple-line heading.

HDR-SUPP

Forms generation commands automatically suppress column headings, but they still generate the one-line heading that lists the time, date, and page number. HDR-SUPP suppresses this one-line heading.

ID-SUPP

Forms generation commands automatically suppress item-IDs, so this modifier is unnecessary in a forms generation statement. If you want to include item-IDs on a form, create an item in the dictionary that has an attribute marker (A/AMC) of 0. Then include an output specification referring to this item in the forms generation statement.

Forms Generation Options

The following non-standard options can be specified with FORMS: A, B, and Z.

The A Option

The A option is used to verify the page layout before the actual forms are generated. The A option runs a printer-alignment routine. This routine prints the first form on the terminal screen or printer, showing text (except for headings and footings) as Xs. This option can be used only if the current SP-ASSIGN statement includes the C and the I options. (See the SP-ASSIGN Command for more details.)

The following prompt appears if the A option is included in the forms generation statement:

Align? Y=cr/N>

Before you respond to this prompt, manually set the printer at the top of the form. Then press ENTER to display or print the data as Xs. Repeat this process as many times as you need to until you get the Xs to print where you want them. Type N at the prompt to print the forms themselves.

The B Option

The B option prints a background form composed of previously created text or graphics. It is printed on every page of a form. To use the B option, you must already have created a background form (background forms are created with the Editor). This background form can be used to print forms on standard paper instead of on preprinted forms. Background forms also make it possible to use printer control characters (for underlining, etc.) that apply to specific printers.

Design a background form so that it is not overwritten by the reserved heading rows 0 and 1, and does not overwrite the data placed on the form with print codes.

The following prompt appears if the B option is included in the forms generation statement:

Background File & Item:

Enter the name of the background file item using the following format:

[DICT] filename item-ID

The Z Option

The Z option is used with the FOOTING modifier. It resets the page number in the footing back to 1 at the beginning of each multipage form. Use the HDR-SUPP modifier with the Z option to prevent an incompatible (not reset) page number from appearing in the heading.

Listing Items on a Form

The following example creates an invoice form for the items in the ORDERS file and lists it on the screen. The orders will eventually be sent to the printer to be printed on preprinted paper that contains constant text:

>FORMS ORDERS @(1,3):FIRST-NAME @(8,3):LAST-NAME @(1,4):STREET @(1,5):CITY @(15,5):STATE @(1,8):DATE @W(1,11,15):TITLE @W(40,11,15):NUM @W(45,11,15):PRICE @(45,17):AMOUNT @(45,18):TAX @(45,19):TOTAL.AMT FOOTING"***THANK YOU FOR YOUR ORDER - HAVE A NICE SUMMER!***" HDR-SUPP

 

DAVID  EDGECOMB

338 BROADWAY

MIAMI         FL

 

17 MAR 1988

 

 

 

DATABASE MANAGEMENT SYSTEMS

1

$9.00

WRITING COMMERCIAL APPLICATIONS

4

$20.00

WORD PROCESSING

1

$20.00

 

 

 

 

 

$229.00

 

 

$11.45

 

 

$240.45

***THANK YOU FOR YOUR ORDER - HAVE A NICE SUMMER!***

The FIRST-NAME, LAST-NAME, STREET, CITY, STATE, DATE, AMOUNT, TAX, and TOTAL.AMT items are single valued items. Their positions on the form are defined with the @A code and x and y coordinates.

The TITLE, NUM and PRICE items are MultiValued items. A window is created for them with the @W code and x, y, and z coordinates.

When the form is printed on preprinted paper, it may look something like this: