7.6

Table Of Contents
l The search loop executes when the emulation encounters a form feed character. The form feed signals the end of a
data page.
l The first if statement handles the current line of data. If the current line of data is a second line, the first block of the
statement executes; the emulation concatenates the line with the previous one and stores the result. If the current line
of data is not a second line, it sets &line to the value of this(first) line of data.
l The second if statement executes the data page if the value of &current.line exceeds the maximum number of lines
in a data page.
l The code toggles the value of &second. after it reads each line of data so it can determine whether the current line of
data is a first or second line.
Print a page n-up
This sample prints a page 12-up, in two columns of 6 each. It uses a runpage . The runpage calls an overlay page, DOCPAGE,
that contains the page to print 12-up, and includes data selections defined in a PlanetPress Talk object. The page to print 12-up
does not require scaling; it is created at the size it prints.
The result is a single page with 12 copies of DOCPAGE. Each row contains 2 copies and each copy in a row displays the same
data selection. Data selections change from row to row.
The sample uses two global variables:
Variable: Type:
Initialized
to:
Description:
&six Integer 0
The code on the runpage uses this as a counter for the number of rows (6) on the printed page. The
data selection on DOCPAGE also use this variable to set the line for the data selection.
&two Integer 0 The code on the runpage uses this as a counter for the number of columns (2) on the printed page.
Code:
% =======================================================
% RUNPAGE CODE: PRINT A PAGE 12-UP
% =======================================================
margin(0,0.125)
for(&six,1,1,6)
for(&two,1,1,2)
execpage('DOCPAGE')
translate(4.25,0)
endfor()
translate(neg(8.5),1.75)
endfor()
% =======================================================
% DOCPAGE CODE: CREATE THE DATA SELECTION
% =======================================================
moveto(0,0)
margin(0.1,0)
setstyle(&header)
show('Supplier district:'+ @(&six,1,30))crlf(0.166)
Notes:
l In the runpage code, the outermost for loop loops six times, and positions the copy of the page in one of
the six rows. The innermost for loop loops twice and positions the copy in one of the two columns.
©2010 Objectif Lune Inc - 238 -