This sample is a user-defined emulation that reads two lines of input data, concatenates them, and stores them as a single line in the data page buffer. It terminates a data page when it encounters a form feed character. The emulation relies on two global variables:
|
Variable: |
Type: |
Initialized to: |
Description: |
|
&second |
Boolean |
False |
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(¤t.line,¤t.line + 1) store(¤t.line,&str) doform() set(&second,false) clearpage() endsearch() if(&second) store(¤t.line,&line + &str) elseif() set(&line,&str) set(¤t.line,¤t.line + 1) endif() set(&second,not(&second)) if(ge(¤t.line,¤t.lpp)) doform() clearpage() set(&second,false) endif()
Notes: