FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Problem with memo text printout
Posts: 3022
Joined: Fri Oct 07, 2005 01:45 PM
Problem with memo text printout
Posted: Thu Feb 13, 2020 07:09 PM

If I write the line " Mitch & Mary went to dinner" in a memo field, on screen it stores it, and displays it, correctly.

If I send it to the printer ( or even Preview ), it will print as "Mitch _ Mary went to dinner"

This occurs in the latest version of FWH, and is not present in the previous builds.

Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Problem with memo text printout
Posted: Fri Feb 14, 2020 10:12 AM

Dear Tim,

Please try it this way:

"Mitch && Mary went to dinner"

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 3022
Joined: Fri Oct 07, 2005 01:45 PM
Re: Problem with memo text printout
Posted: Fri Feb 14, 2020 04:49 PM

Antonio,

My clients don't write that way. It worked perfectly until the latest build of FWH. Anything in a memo field printed just like it was viewed on the screen.

My clients DO NOT LIKE CHANGE and so they are very upset with this right now. As programmers it might not be a big deal, but we write for our customers and their feelings matter.

Tim

Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: Problem with memo text printout
Posted: Fri Feb 14, 2020 05:15 PM

Tim,

A quick fix would be to pre-print modify the TXT file by doing a search for "&" and replace it with "&&" before sending it to the printer.

Of course a better fix would be for the FW code to be fixed. Do you have software to do a file1 verses file2 comparison? That way you can find the changed code and post it here. If you don't have software for that I can point you to one.

James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Problem with memo text printout
Posted: Sat Feb 15, 2020 12:51 PM
Thanks for pointing out. The problem is in the method SayText().
While methods Say(), cmSay() print the & character as expected, the method SayText() converts & as underscore of the next character (default behaviour of DrawTextEx()). This is bug in printer.prg and needs to be fixed.

But the problem is not new to the latest build. This behavior has been there in all builds from FWH1605 onwards till FWH1912. It might not have been noticed earlier but noticed now.



Fix for this will be available in the next release.

Now this fix may be applied to the printer.prg of any existing versions in this way:

Please locate these lines (990 to 994 in fwh1912) in method SayText() of printer.prg:
Code (fw): Select all Collapse
   if lByRef
      nRet  := FW_SayText( ::hDCOut, @cText, aRect, cAlign, oFont, nClrText, nClrBack )
   else
      nRet  := FW_SayText( ::hDCOut,  cText, aRect, cAlign, oFont, nClrText, nClrBack )
   endif


Please modify these lines by adding 2 more parameters to FW_SayText() like this:
Code (fw): Select all Collapse
   if lByRef
      nRet  := FW_SayText( ::hDCOut, @cText, aRect, cAlign, oFont, nClrText, nClrBack, nil, 0x800 )
   else
      nRet  := FW_SayText( ::hDCOut,  cText, aRect, cAlign, oFont, nClrText, nClrBack, nil, 0x800 )
   endif
Regards



G. N. Rao.

Hyderabad, India
Posts: 3022
Joined: Fri Oct 07, 2005 01:45 PM
Re: Problem with memo text printout
Posted: Tue Feb 18, 2020 04:31 PM

Thank you. I'll do the patch this morning.

Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit

Continue the discussion