6.0

Table Of Contents
154
Language Reference
4
Code Sample Example
This example is taken for an OnReadDataPage event for a user defined emulation. It shows how to store
lines of text in the current data page. It searches for a formfeed, increases the current line, stores the string,
executes the document, resets the page, and then ends the search.
Example
search(&str,'\014')
set(&current.line,&current.line+1)
store(&current.line,&str)
doform()
clearpage()
endsearch()
&Str (system variable)
Contains a line of input data.
Syntax
&str string
Code Sample Example
This example illustrates afew lines of code from a user-defined emulation. In these lines, if the line of input
data (minus any leading spaces)begins with the code ‘5’, the emulation advances to the next line of the
data page and stores the line of input data on that line. Notice the &current.line system variable—one of
the variables in the current system object.
Example
if(eq(mid(trimleft(&str),1,1),'5'))
set(&current.line,&current.line + 1)
store(&current.line,trimleft(&str))
endif()
StringReplace (function)
Replaces all occurrences of a pattern within a string, with another pattern.
Syntax
stringreplace( string, old, new) string