Problem with memo text printout

Problem with memo text printout

Postby TimStone » Thu Feb 13, 2020 7: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
User avatar
TimStone
 
Posts: 2945
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: Problem with memo text printout

Postby Antonio Linares » 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
User avatar
Antonio Linares
Site Admin
 
Posts: 42122
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Problem with memo text printout

Postby TimStone » Fri Feb 14, 2020 4: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
User avatar
TimStone
 
Posts: 2945
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: Problem with memo text printout

Postby James Bott » Fri Feb 14, 2020 5: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
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Problem with memo text printout

Postby nageswaragunupudi » 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.

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  Expand view  RUN

   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  Expand view  RUN

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

Re: Problem with memo text printout

Postby TimStone » Tue Feb 18, 2020 4: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
User avatar
TimStone
 
Posts: 2945
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: nageswaragunupudi and 42 guests