FWH1904: Printing Memos, Snaking columns and Multiple Pages

FWH1904: Printing Memos, Snaking columns and Multiple Pages

Postby nageswaragunupudi » 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: Select all  Expand view

#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
 


Image
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10468
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: FWH1904: Printing Memos, Snaking columns and Multiple Pages

Postby Silvio.Falconi » Sun Apr 14, 2019 3:24 pm

forget..Justification ?
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 6897
Joined: Thu Oct 18, 2012 7:17 pm

Re: FWH1904: Printing Memos, Snaking columns and Multiple Pages

Postby nageswaragunupudi » Sun Apr 14, 2019 3: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
User avatar
nageswaragunupudi
 
Posts: 10468
Joined: Sun Nov 19, 2006 5:22 am
Location: India


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Jimmy and 52 guests