Sample data - user defined Emulation

Posted by: dwal

Sample data - user defined Emulation - 05/03/21 12:02 PM

I have a variable length data- total of 2 pages. Page 1 is between 80-100 lines long. I would like to break to page two before I see a certain word. I believe that I need to use the user defined emulation, but I could not figure out how to begin a new page before I see a word phrase.
How can I begin page two (need to include the word phrase on page 2) when I see a unique word phrase.
Posted by: Philippe F.

Re: Sample data - user defined Emulation - 05/04/21 12:32 PM

Something like this in the user defined emulation should work:
Code:
define(&tmp,string,&str)
search(&tmp,'MY_KEY_WORD')
  doform()
  clearpage()
endsearch()
set(&current.line,&current.line + 1)
store(&current.line,&str)
if(ge(&current.line,&current.lpp))
  doform()
  clearpage()
endif()