Problem with memo text printout

Post Reply
User avatar
TimStone
Posts: 2536
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA
Contact:

Problem with memo text printout

Post by TimStone »

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
timstone@masterlinksoftware.com
Using: FWH 19.06 with Harbour 3.2.0 / Microsoft Visual Studio Community 2019
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Problem with memo text printout

Post by Antonio Linares »

Dear Tim,

Please try it this way:

"Mitch && Mary went to dinner"
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
TimStone
Posts: 2536
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA
Contact:

Re: Problem with memo text printout

Post by TimStone »

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
timstone@masterlinksoftware.com
Using: FWH 19.06 with Harbour 3.2.0 / Microsoft Visual Studio Community 2019
User avatar
James Bott
Posts: 4654
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA
Contact:

Re: Problem with memo text printout

Post by James Bott »

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
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: Problem with memo text printout

Post by nageswaragunupudi »

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.

Image

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: Select all

   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: Select all

   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
User avatar
TimStone
Posts: 2536
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA
Contact:

Re: Problem with memo text printout

Post by TimStone »

Thank you. I'll do the patch this morning.
Tim Stone
http://www.MasterLinkSoftware.com
timstone@masterlinksoftware.com
Using: FWH 19.06 with Harbour 3.2.0 / Microsoft Visual Studio Community 2019
Post Reply