Forms Control. DORIC 9.65, INFO-Text software
Hirdetés
Hirdetés
FORMS CONTROL
FC
FC
FC
FC
FC
FC
CL
OSE
C
REATE end_line,page_width
D
UMP start_line,line_count [
SCREEN
]
F
ORM SF_name
I
NIT start_line,line_count
PR
INT line DF_item system_item system_variable string
#
X
#
T
FC P
UT line,column,content [,content_width [,decimals]
,
D
[,content_width]]
allows you to create or execute output forms in INFO programs.
arguments
CLOSE terminates the FC session and closes all files used by INFO in processing the FC commands.
CREATE end_line,page_width opens and initializes the form, and defines its page size. End_line defines the total number of lines in the form (1—1200). Page_width defines the number of characters (1—200) per line.
DUMP start_line,line_count [SCREEN] requests that
INFO copy the FC form to the screen or spool file, starting with the line defined by start_line for the number of lines specified by line_count. If you omit the line_count, INFO copies the entire form.
SCREEN option requests that the dump be displayed at the terminal; otherwise, the dump goes to the spool file.
FORM SF_name identifies a special form used to write information in the FC form work area. The named SF must be defined in the current directory. Generally, a special form is used to move standard information
(headers, footers, etc.) to the work area.
INFO Reference Manual Commands 245
FORMS CONTROL
INIT start_line,line_count clears the number of lines specified by line_count from the FC work area, beginning with start_line.
PRINT line [DF_item | system_item | system_variable |
string | #X | #T] writes an entire line to the FC form work area. This option uses all of the PRINT command options.
DF_item an INFO data file item.
system_item an INFO system item.
system_variable an INFO system variable.
string a character string enclosed with single quotes.
#X specifies the number of spaces (1—131) to insert before the next print item.
#T indicates the column number (limited by the width of your printer) at which to position the next print item.
If you use the space or tab options, your specifications should, in most cases, not cause the line to extend beyond the form width. If a line exceeds the form width, your printer may wrap the lines.
PUT line,column,content [,content_width [,decimals] |
,D [,content_width]] writes a single item to the FC form work area.
line,column defines the position on the form to place the item: line is the vertical position on the form; column is the horizontal position. The top left-hand position is line 1, column 1. However, any character that appears in column
1 will be treated as a carriage control character. Each argument can be a constant, an item, or a system variable.
content is the information to be placed on the form. It can be a string, a data item, a system item, a system variable, or an arithmetic expression whose value becomes the content.
content_width defines the output width of the content field. In the absence of a width specification, the default is the defined or formatted OUTPUT WIDTH value for the data item or system variable, or 12 spaces for an arithmetic expression.
246 Commands INFO Reference Manual
notes
FORMS CONTROL
decimals an integer that defines the number of decimal places for the associated content field. It applies only for numeric content fields and requires the preceding width specification. It defaults to 2 positions for calculated values and to the defined or formatted DECIMAL PLACES value for other items.
D formats the content into a date (D type) and is valid only when the content is an arithmetic expression involving dates. When processing a date, INFO assumes the result is a numeric field unless you include the D option to specify a date result. When D is specified, content-width is required and is generally defined as 5, 8, or 10.
For example, FC PUT 10,10,$REPDAT + 3,D,8 puts the value of the report date, plus 3 days, in the format
10/ 7/96, at position line 10, column 10 on your form.
n
Note that FC definitions are never saved; each FC command overwrites the area used by previous FC commands.
n
If you use both a tab (T option) and space specification (X option) to position an item on a line and the two specifications conflict (such as 20X,5T), then the tab specification overrides the X option.
n
Note that DUMP does not clear the FC work area; all data remains unchanged and can be added to or replaced using subsequent FC commands.
There cannot be more than 30 data file items specified using a PRINT option.
INFO Reference Manual Commands 247
FORMS CONTROL discussion example
The FC command permits customized formatting of output forms from within INFO programs. Using the FC command, you can define a form of any size up to a maximum page length of 1,200 lines and a maximum page width of 200 characters. Space on the FC form is referenced in terms of line, column co-ordinates, or a starting line and number of lines. For optimal efficiency, specify the form top to bottom, serially processing all information for each line completely before moving on to the next line. You must start the FC sequence using the
CREATE option, and you should end it using the CLOSE option.
The FC command allows you to represent multiple records on a single page, whereas the SF command allows only one record per form.
The program example below produces an invoice for each customer in a file called ACCOUNTS, listing the multiple purchases for each account from a related SALES file.
The top of each invoice is generated from a predefined special form file called S.HEADING. Following is a sample of an invoice.
ACCOUNT NO: 2000
COMPANY: ACME CONSTRUCTION
25 BEACON STREET
BOSTON, MA 02211
10/7/96
*************************************************************
3/12/1992
4/11/1992
6/ 6/1993
TOTAL SALES :
400.00
765.00
2000.00
3,165.00
248 Commands INFO Reference Manual
FORMS CONTROL
ENTER COMMAND >TYPE F.EXAMPLE
PROGRAM NAME: F.EXAMPLE
10000 PROGRAM SECTION ONE
10001 SELECT ACCOUNTS
10002 RELATE SALES BY ACCT-NO
10003 FC CREATE 40,80
10004 FC FORM S.HEADING
10005 FORMAT $CHR1,30,C
10006 FORMAT $NUM10,2,I
10007 CALCULATE $NUM10 = 10
10008 FORMAT $NUM15,8,10,N,2
10009 CALCULATE $NUM15 = 0
10010 MOVE NAME TO $CHR1
20000 PROGRAM SECTION TWO
20001 IF NAME NE $CHR1
20002 MOVE NAME TO $CHR1
20003 FC FORM S.HEADING
20004 ENDIF
20005 FC PRINT $NUM10 25T,$1DATE,38T,$1TOTAL-SALES
20006 CALCULATE $NUM15 = $NUM15 + $1TOTAL-SALES
20007 CALCULATE $NUM10 = $NUM10 + 1
20008 NEXT
20009 CALCULATE $NUM10 = $NUM10 + 3
20010 FC PRINT $NUM10 20T,'TOTAL SALES :',36T,$NUM15
20011 FC DUMP 1,40
20012 FC INIT 1,40
20013 CALCULATE $NUM10 = 10
20014 CALCULATE $NUM15 = 0
30000 PROGRAM SECTION THREE
30001 SPOOL
30002 FC CLOSE
99999 PROGRAM END
see also
SPECIAL FORM (SF)
INFO Reference Manual Commands 249
Letöltés
Hirdetés