7.4

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 line of text on odd-numbered pages
This sample prints a line of text only on odd-numbered pages. It uses the system integer variable &current.printpage, and
assumes you add a PlanetPress Talk object containing this code to every page in your document.
Code:
% =======================================================
% PRINT A LINE OF TEXT ON ODD-NUMBERED PAGES ONLY
% =======================================================
if(eq(mod(&current.printpage,2),1))
margin(1.5,9.75)
show('See reverse side of this page')
endif()
Notes:
l If you use a runpage, you would integrate this code into the runpage code.
Determine the proper page to print based on the width of the data in the data page
In this sample, the document contains three different pages and a runpage that manages execution of the three pages.
Each document page has a different page width and accommodates data of a specific line length. The code determines which
document page to use with a given data page based on the length of line 5 of the data page. The three page widths are 198 col-
umns, 132 columns, and 80 columns.
Code:
% =======================================================
% SELECT THE PROPER PAGE FOR THE CURRENT DATA
% =======================================================
if(trimleft(@(5,198,1))<>'')
execpage('198ColPage')
elseif()
if(trimleft(@(5,132,1))<>'')
execpage('132ColPage')
elseif()
execpage('80ColPage')
endif()
endif()
©2010 Objectif Lune Inc - 241 -