>Nadya, thanks. I'll check these articles. I can add a field to the data file to store calculated length of each record at a given memo width - allowing me to compare remaining page lines and the longest of the pair to print next. Im not yet sure how I can use this variable to throw a page. Something to do with 'Starting a new group on a new page' perhaps. Is this a good time to mention how impressive the UT web site is? I am quite taken aback by it.
Denis,
I was thinking about this problem and bellow is a scheme for solution (simplified, of course):
Add a field to your table called nPage (I).
Create a program, similar to this:
local nPage, lnLinesCount
nPage=1
lnLinesCount = 0
#define MAX_LINES_PER_PAGE 40
scan
if m.lnLinesCount > MAX_LINES_PER_PAGE
nPage = m.nPage+1
lnLinesCount = memlines()
else
lnLinesCount = m.lnLinesCount + memlines()
endif
scatter field nPage memvar
endscan
Of course, this is just an idea, and your real program would be much more complicated... Set group by nPage and set it to start from the New Page.
Hope this helps.
If it's not broken, fix it until it is.
My Blog