7.5

Table Of Contents
Variable: Type: Initialized to: Description:
&second BooleanFalse
The emulation uses this to determine when the current line is a second line of data. It is True
when the current line is a second line of data.
&line string
(the empty
string)
Holds the contents of a first line of data.
Code:
% ====================================================
% STORE TWO LINES OF DATA ON ONE LINE OF THE DATA PAGE
% ====================================================
search(&str,'\014')
set(&current.line,&current.line + 1)
store(&current.line,&str)
doform()
set(&second,false)
clearpage()
endsearch()
if(&second)
store(&current.line,&line + &str)
elseif()
set(&line,&str)
set(&current.line,&current.line + 1)
endif()
set(&second,not(&second))
if(ge(&current.line,&current.lpp))
doform()
clearpage()
set(&second,false)
endif()
Notes:
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
©2010 Objectif Lune Inc - 241 -