2020.2

Table Of Contents
(that is, the count of delimiters that have been encountered). Each time the count is a multiple of
3, it could set a new record boundary. This is basically what happens when setting the trigger to
On Page and specifying 3 as the Number of Pages.
Note
Remember that a boundary script is being called on each new delimiter encountered by
the DataMapper parsing algorithm. If for instance a database query returns a million
records, the script will be executing a million times! Craft your script in such a way that it
doesn't waste time examining all possible conditions. Instead, it should terminate as soon
as any condition it is evaluating is false.
Accessing data
Data available inside each event
Every time a delimiter is encountered, an event is triggered and the script is executed. The
event gives the script access to the data between the current location - the start of a row, line or
page - and the next delimiter. So at the beginning of the process for a PDF or text file, you have
access to the first page only, and for a CSV or for tabular data, that would be the first row or
record.
This means that you can:
l Examine the data found in between delimiters for specific conditions.
l Examine specific regions of that data, or the available data as a whole.
l Compare the contents of one region with another.
l Etc.
To access this data in the script, use the get() function of the boundaries object. This function
expects different parameters depending on the type of source file; see "get()" on page387.
Getting access to other data
Data that is not passed with the event, but that is necessary to define the record boundaries,
can be stored in the boundaries object using the setVariable function (see "boundaries" on
page384 and "setVariable()" on page389). The data can be retrieved using the boundaries'
getVariable function (see "getVariable()" on page387).
Page 378