FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour FWH1904: Printing Memos, Snaking columns and Multiple Pages
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
FWH1904: Printing Memos, Snaking columns and Multiple Pages
Posted: Sun Apr 14, 2019 10:10 AM
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:
Code (fw): Select all Collapse
#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
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: FWH1904: Printing Memos, Snaking columns and Multiple Pages
Posted: Sun Apr 14, 2019 03:24 PM

forget..Justification ?

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: FWH1904: Printing Memos, Snaking columns and Multiple Pages
Posted: Sun Apr 14, 2019 03:30 PM
Silvio.Falconi wrote:forget..Justification ?

Did not forget.
This feature is useful.
Justification is cosmetic and takes second priority.
Regards



G. N. Rao.

Hyderabad, India

Continue the discussion