6.0

Table Of Contents
Code Samples
25
Notes
• The search loop e xecutes when the emulation encounters a form feed character. The form feed signals
the end of a data page.
• 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.
• The second if statement executes the data page if the value of &current.line exceeds the maximum
number of lines in a data page.
• 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:
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()
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.