
ADOBE FRAMEMAKER 10
MIF Reference
232
The code for the procedure that extracts information from the database and outputs the MIF strings is shown in this
appendix. This procedure is written in the ACIUS 4th DIMENSION command language. You could use any database
query language to perform the same task.
The procedure does the following:
7
Creates a new document.
8
Sends the
MIFFile
identification line.
9
Uses
include
to read in the formatting information stored in the template
coffee.mif
.
10
Sends the MIF statements to create a table instance.
11
In each body cell, sends a field that includes the information extracted from the database.
12
Creates a text flow that uses the
TextRectID
from the empty body page in the
coffee.mif
template.
13
Includes the
Atbl
statement that places the table instance in the document text flow.
14
Closes the document.
In the following example, database commands are shown like this:
SEND PACKET
. Comments are preceded by a
single back quote (
`
). Local variables are preceded by a dollar sign ($).
`This procedure first gets the information entered by the user and stores it in local variables:
` $1 = Name of sales representative
` $2 = Phone number
` $3 = Discount
CR:=
char
(13) ` carriage return character
DQ:=
char
(34) ` double quotation mark character
C_TIME
(vDoc)
CLOSE DOCUMENT
(vDoc)
vDoc:=
Create document
("")
vDisc:=1-(
Num
($3»)/100)
`Send header.
SEND PACKET
(vDoc;"<MIFFile
8.00
> #Generated by 4th Dimension for Version 7.0 of
FrameMaker"+CR)
`Read in the MIF template for the report.
SEND PACKET
(vDoc;"include (coffee.mif)"+CR)
`Generate table.