It is known that it is possible to print a memo (multiline text) with a single call to oPrn:SayText( cText, aRect, ... ) instead of splitting the memo into single lines and printing the lines one by one. Sometimes, it is possible to have long memos, which do not fit into the rectangular area specified in a single page.
Now, it is possible to know if the entire text is printed of any text is remaining, so that it can be printied in the next page or next column in case of snaking columns.
Here is a sample:

Now, it is possible to know if the entire text is printed of any text is remaining, so that it can be printied in the next page or next column in case of snaking columns.
Here is a sample:
#include "fivewin.ch"
function Main()
local cText1, cText2, cText, nRow, nCol, nHt, nPage, nLastRow
local oPrn, oFont
cText1 := MEMOREAD( "english.txt" )
PRINT oPrn PREVIEW
DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-14 OF oPrn
PAGE
cText := cText1
nRow := 2.0
nCol := 1.0
nHt := 6.5
nLastRow := 0
nPage := 1
do while !Empty( cText )
nLastRow := oPrn:SayText( nRow, nCol, @cText, 3.0, nHt, oFont,,,, "INCHES" )
if Empty( cText )
oPrn:SayText( nLastRow + 0.25, nCol, "--- End of Text ---", 3.0, 0.5, oFont, "",,, "INCHES" )
else
if nCol < 4
nCol += 3.25
else
oPrn:SayText( nLastRow + 1, 1, "Continued on next page", 6.25, 0.5, oFont, "TR",,, "INCHES" )
//
ENDPAGE
PAGE
//
nPage++
oPrn:SayText( 1, 1, "Page: " + cValToStr( nPage ), 6.25, 0.5, oFont, "TR",,, "INCHES" )
nCol := 1
endif
endif
enddo
ENDPAGE
ENDPRINT
RELEASE FONT oFont
return nil
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India